Custom Date Formats for Your Rails Application
If you use a consistent date format often in your Rails applciation, it is worth it to add the format to your application environment. You can do this by adding it to the bottom of the config/environment.rb file.
Time::DATE_FORMATS[:my_custom_format] ...
Written by Sean Behan on 06/17/2012
Combat Spam with the Akismet Class for Ruby
Here is the Akismet.rb class, written by David Czarnecki. I've seen several tutorials online using this class, however, the class isn't available at David's blog. So... I reposted it here and at the pastie link below
http://pastie.org/1150693
...
Written by Sean Behan on 06/17/2012
How to Dynamically Call a Method from a String in Swift
You have to subclass NSObject
class Car : NSObject {
func drive(){
print("Driving..")
}
}
let car : Car = Car()
car.perform(NSSelectorFromString("drive"))
Written by Sean Behan on 06/09/2018
Manage Fixtures with Yaml DB Plugin for Rails
Get the plugin like so...
script/plugin install git://github.com/adamwiggins/yaml_db.git
This command will dump your data
rake db:data:dump
And load it back
rake db:data:load
Beautiful :) More info here
http://blog.heroku.com/archives/2007/11/23/yam...
Written by Sean Behan on 06/17/2012
Dot htaccess file for wordpress installation (.htaccess)
Login to your wordpress installation and scroll to and click the second to last link set "Settings". You'll need to configure wordpress to handle your new links as "permalinks". Make a selection and copy the code into your .htaccess file. Wordpress will a...
Written by Sean Behan on 06/17/2012