Skip to content

Instantly share code, notes, and snippets.

working on datafruits

Tony Miller mcfiredrill

working on datafruits
Block or report user

Report or block mcfiredrill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1157928
require 'rubygems'
require 'haml'
@template =[0])
@engine =
@template_scope =
@partials = {}
Dir.glob("./src/_*.haml").each do |f|
partial_name = f.sub(/_/, '')
View gist:1160972
task :update do
system("rsync -rv build/*")
mcfiredrill / cache_assertion_method.rb
Created Oct 26, 2011
☺ 263A 1 ☻ 263B 2 ♥ 2665 3 ♦ 2666 4 ♣ 2663 5 ♠
View cache_assertion_method.rb
def assert_cache_works(key, procs)
#code that creates cache
assert Rails.cache.exist?(key)
#code that should clear the cache
assert !Rails.cache.exist?(key)
View wakabadoggle.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *tag(char *dest, char* tag, char* closing_tag){
char *out = malloc(1024);
out = strncat(out, tag, strlen(tag));
out = strncat(out, dest, strlen(dest));
out = strncat(out, closing_tag, strlen(closing_tag));
mcfiredrill / logggggggg.rb
Created Feb 29, 2012
logging from delayed_job
View logggggggg.rb
class MyJob
def initialize(blahblah)
@blahblah = blahblah
@logger ||=, 'log', 'delayed_job.log'))
def perform
@logger.add Logger::INFO, "logging from delayed_job"
#do stuff
mcfiredrill / blog.rb
Created Mar 27, 2012
static blog dealie to embed into sinatra
View blog.rb
require 'yaml'
class BlogArticle
attr_reader :date, :title, :tags, :page
def initialize(file)
f =
y = YAML.load(f.split("---\n")[1])
@title = y[:title]
@date = Date.parse y[:date]
mcfiredrill / bundle update
Created Apr 10, 2012
undefined method `tempfile'
View bundle update
Using rake (
Using activesupport (3.0.10)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.10)
Using arel (2.0.10)
Using tzinfo (0.3.33)
Using activerecord (3.0.10)
Using aasm (3.0.4)
Using abstract (1.0.0)
View blog.rb
# encoding: utf-8
class BlogArticle
def initialize(file)
f =
puts "the encoding: #{f.encoding}"
y = YAML.load(f.split("---\n")[1])
# output:
# the encoding: US-ASCII
View foo_job.rb
class FooJob < JobBase
@@model_name = Foo
mcfiredrill / pry
Created May 10, 2012
class variable as attr_accessor...
View pry
[2] pry(main)> b =
=> #<Boo:0x9deaa90 @stuff=2>
[3] pry(main)> b.blah
=> "thingsmorethings"
You can’t perform that action at this time.