Three free documentaries exposing the manipulation of a select few over the masses. Whether you believe the facts or not, the “evidence” is compelling.
Three free documentaries exposing the manipulation of a select few over the masses. Whether you believe the facts or not, the “evidence” is compelling.
Note: This is a summary of this article - the page is unaccessible at the time of writing
./script/plugin install \
http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk/
class Person < ActiveRecord::Base
acts_as_state_machine :initial => :sleeping
state :sleeping
state :showering
state :working
state :dating
event :shower do
transitions :from => :sleeping, :to => :showering
transitions :from => :working, :to => :showering
transitions :from => :dating, :to => :showering
end
event :work do
transitions :from => :showering, :to => :working
# Going to work before showering? Stinky.
transitions :from => :sleeping, :to => :working
end
event :date do
transitions :from => :showering, :to => :dating
end
event :sleep do
transitions :from => :showering, :to => :sleeping
transitions :from => :working, :to => :sleeping
transitions :from => :dating, :to => :sleeping
end
end
Note: The plugin makes the assumption that the state of your model is saved in a field called state. This can be replaced by adding the additional option :column => ‘field’. Beware of address fields that have a state field!
We can now see what state an object has by calling state? : Person.find(:first).sleeping?
The specified events also create usefull instance methods to transition from one state to another : Person.find(:first).work!
1 year agoIf you want to get rid of Leopard’s Spotlight from the menu bar, simply open terminal and run:
sudo chmod 0 /System/Library/CoreServices/Spotlight.app
To re-enable it you just have to run:
sudo chmod 755 /System/Library/CoreServices/Spotlight.app
1 year ago
I’m loving the new terminal in Leopard. We finally have tabs! Time to say goodbye to iTerm …
2 years agoFor managing models that have a “state” - the transitions between different states look neat.
defaults write com.apple.Terminal TermCapString xterm
Thanks atomized
Update : a simpler ways is to add this line to your .profile
export TERM=xterm
You can turn on vi-style by entering the following line in your ~/.inputrc file :
set editing-mode vi
Thanks slash7!
2 years agoFor some obscure reason, HAML uses single quotes to surround HTML attributes by default. Of course, you probably want double-quotes in your HTML files ;-) Just paste this line in config/environment.rb
Haml::Template.options[:attr_wrapper] = '"' 2 years ago
The easiest way by far to install and update bundles in Textmate is to use the GetBundle Bundle. Once installed, it provides a GUI for browsing and installing bundles from the Textmate bundle repository.
Character encoding is probably my singlest biggest gripe with MySQL. To force a table’s character set and collation to UTF-8, use this command :
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; 2 years ago
Gotapi is a cool little ajaxified api hub - it’s deadly having so many good resources in one place.