Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aaronblohowiak
aaronblohowiak / dabblet.css
Created February 23, 2014 04:11 — forked from LeaVerou/dabblet.css
Unprefixed animations do nothing in Blink
/**
* Unprefixed animations do nothing in Blink
*/
@-webkit-keyframes foo {
to { background: lime; }
}
body { background: red; -webkit-animation: foo 1s infinite; }
@aaronblohowiak
aaronblohowiak / dabblet.css
Created February 23, 2014 04:14 — forked from LeaVerou/dabblet.css
Unprefixed animations do nothing in Blink
/**
* Unprefixed animations do nothing in Blink
*/
@keyframes foo {
to { background: lime; }
}
div { background: red; animation: foo 1s infinite; }
require 'rubygems'
require 'sinatra'
require 'activerecord'
require 'sqlite3'
configure do
ActiveRecord::Base.establish_connection(
:adapter=>'sqlite3', :dbfile=>'delish.db')
@results = ActiveRecord::Base.connection.execute(<<-TABLESQL)
Who: Aaron Blohowiak, copyright 2008 (c) FooMojo, Inc. MIT license.
Why: The Goal of Play It Once, Sam (henceforth: PIOS) is to bring programming
best practices to projects that haven't followed them.
What: In achieving this goal, PIOS is presently a tool that creates Integration
Tests.
def inspect_it(name, thing)
%w{to_s class inspect}.each do |m|
print "#{name}.#{m}: "+ thing.send(m.to_sym)+"\n"
end
end
set_trace_func proc { |event, file, line, id, binding, classname|
%w{event file line id binding classname}.each do |arg|
inspect_it(arg, eval(arg))
end
# Behavior filter turns method names into select/reject filters
# Example
# class User
# has_manny :comments, :extend => BehaviorFilter
# end
module BehaviorFilter
# creates magic methods like these
# user.comments.from_blocked_commentors
# # => user.comments.select{ |c| user.blocking?(c.commentor) }
>> a = Hash.new({})
=> {}
>> a["hi"]["pants"] = "clamdiggers"
=> "clamdiggers"
>> a.inspect
=> "{}"
>> a["hi"]
=> {"pants"=>"clamdiggers"}
>> #hmmmmm...
>>
require 'ostruct'
class Pearl < OpenStruct
alias_method :open_structs_method_missing, :method_missing
def method_missing(meth, *args)
if meth.to_s =~ /=$/
open_structs_method_missing(meth, *args)
else
self.new_ostruct_member(meth)
require 'rubygems'
require 'sinatra'
require 'open-uri'
require 'java'
require File.dirname(__FILE__)+"/jtidy-r938.jar"
Dir.glob(File.dirname(__FILE__)+"/flyingsaucer/*.jar").each do |f|
require f
end
class Face
love = 5
get_love = Proc.new{ love }
puts get_love.call
define_method :get_love, &get_love
def love
:wtf_lol
end