Skip to content

Instantly share code, notes, and snippets.

View devth's full-sized avatar
Hacking on @yetibot

Trevor Hartman devth

Hacking on @yetibot
View GitHub Profile
@devth
devth / rails_logger.rb
Created October 19, 2010 04:25
Useful parameter inspection in rails
logger.info params.inspect
@devth
devth / git_based_deploy.rb
Created October 19, 2010 23:06
Git-based deployment for non-rails using Capistrano
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart do ; end
desc "Deploy the app"
task :default do
update
end
~
└── work
├── bianchi_usa
│   ├── bike_designer_html5_prototype
│   └── pistafixie.com
├── rivendell_bicycle_works
│   └── rivendell.com
└── surly_bikes
└── surlybikes.com
ln -s ~/work/rivendell_bicycle_works/rivendell.com ~/rivendell.com
var solos = {
// FACEBOOK
facebook: {
settings: {
api: 'https://graph.facebook.com/{username}/feed?limit={posts}&callback=?',
post_builder: build_facebook_post,
data_handler: function (data, settings, jq){
$.each(data.data, function (i, item){
$(jq).append(settings.post_builder(item, settings));
});
var solos = {}
// FACEBOOK
solos["facebook"] = {
settings: {
api: 'https://graph.facebook.com/{username}/feed?limit={posts}&callback=?',
post_builder: build_facebook_post,
data_handler: function (data, settings, jq){
$.each(data.data, function (i, item){
$(jq).append(settings.post_builder(item, settings));
@devth
devth / rails_permalinks.rb
Created October 25, 2010 23:50
A simple, well-known permalink pattern
set tabstop=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
<%= @neighborhoods.to_json(:include => {:addresses => {:include => :spot}}).html_safe %>