Skip to content

Instantly share code, notes, and snippets.

View bkutil's full-sized avatar

Balázs Kutil bkutil

View GitHub Profile
@bkutil
bkutil / dead_models.rb
Created August 24, 2012 08:39
Simple script for scanning a file for possible model references, then filtering out those which no longer exist in app/models.
#!/usr/bin/env ruby
require 'rubygems'
require 'machete'
rails_root = ARGV[0]
file = ARGV[1]
if rails_root.nil? || !File.exists?(rails_root) || file.nil? || !File.exists?(file)
warn "Usage: dead_models <rails root> <source file>"
@bkutil
bkutil / gist:2205462
Created March 26, 2012 14:26
A testing gist for embedding into the bootstrap theme for octopress
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
@bkutil
bkutil / deploy.rb
Created December 4, 2011 22:22 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')