Skip to content

Instantly share code, notes, and snippets.

Avatar
🙅‍♀️
Job hunting

Tamara Temple tamouse

🙅‍♀️
Job hunting
View GitHub Profile
View cequel-database_cleaner.rb
# in spec_helper.rb
RSpec.configure do |config|
records = []
config.before :suite do
Cequel::Record.descendants.each do |klass|
klass.after_create {|r| records << r }
end
end
@tamouse
tamouse / kestell_tables.js
Last active August 29, 2015 14:07 — forked from kkestell/gist:ade30f868bd122707628
a javascript table formatter on the cheap
View kestell_tables.js
/*
Basic Usage
===========
Assuming your markup looks like this:
<table id="table" class="table"></table>
<div id="pagination" class="text-center"></div>
@tamouse
tamouse / Property.rb
Last active August 29, 2015 13:55 — forked from anonymous/Property.rb
View Property.rb
class Property < ActiveRecord::Base
belongs_to :detail
end
@tamouse
tamouse / pipes.rb
Created January 22, 2014 22:28 — forked from rklemme/pipes.rb
View pipes.rb
#!/usr/bin/ruby -w
if ENV['DEBUG']
def debug(message)
$stderr.puts message
end
else
def debug(message)
# nop
end
@tamouse
tamouse / blocks.rb
Last active January 3, 2016 05:09 — forked from jaw6/blocks.rb
View blocks.rb
require 'minitest/autorun'
class List
include Enumerable
def initialize()
@notes = []
yield @notes if block_given?
end
View haml_converter.rb
# _plugins/haml_converter.rb
module Jekyll
class HamlConverter < Converter
safe true
def setup
return if @setup
require 'haml'
@setup = true
View timed_command.rb
[21] pry(main)> kill_subprocess('yes',2,2)
Timed Out!
Tries: 1
Timed Out!
Tries: 2
=> "yes completed"
[22] pry(main)>
View application_controller.rb
def object_changed?(instance, params)
instance.attributes != instance.attributes.merge(params)
end
View ll.rb
current_account.
report_groups.
where(:id => params[:report_group_id]).
first.
reports.
where(:id => params[:id]).
first