Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
ryanbriones / 0_input.html
Created February 6, 2014 14:44
Is there something in Ruby (in an existing gem?) that will take an HTML String, parse out a form, and return URI-encoded query string of the fields/values a la jQuery's form.serialize?
<form>
<input type="text" name="post[title]" value="Some Title" />
<textarea name="post[body]">This is my post body</textarea>
</form>
function square(n) {
return n * n;
}
function double(n) {
return n * 2;
}
function compose() {
var originalRecur = [];
@ryanbriones
ryanbriones / README.md
Created August 8, 2014 15:49
WTF NULL HIVE?

Can anybody tell me what's going on here? Everything I've read says to use "\N" for both STRINGs and non-STRINGs, but Hive is treating them differently. WTF?

// Is there a better way when using call from href?
$(document).ready(function() {
$.extend($.facebox.settings, {inited: false});
$(document).bind('init.facebox', function() {
$('#facebox .close_image').hide();
});
}):
require "benchmark"
TIMES = (ARGV[0] || 1_000_000).to_i
class A
def to_s
"foo"
end
end
class MyMailerClassTest < ActionMailer::TestCase
def test_should_render_special_template_under_circumstance
mailer = MyMailerClass.send(:new, 'mailer_method') # new('mailer_method') is a short cut for new.create!('mailer_method')
assert_equal 'special_template.html.erb', mailer.template
end
end
javascript:u=window.location.href.split(/\//);r=u[3]+'/'+u[4];s=prompt('Github Code Search ('+r+')');if(s==null)return;q=s+' repo:'+r;window.location.href='http://github.com/search?q='+q
# spec/spec_helper in waves project
require 'rubygems'
require 'waves'
require 'runtime/console'
require 'spec'
Waves::Console.load(:mode => 'test')
require File.expand_path(File.dirname(__FILE__) + '/../configurations/test')
Spec::Runner.configure do |config|
dumont:~ ryanbriones$ /usr/bin/curl -i -F 'login=ryanbriones' -F 'token=[REDACTED]' https://github.com/api/v1/json/ryanbriones/[REDACTED]/commits/master
(*
Open New Webkit Window.scpt
Open a new Webkit window in the current space
Used in conjunction with Quicksilver
*)
tell application "System Events"
if (count (processes whose name is "Webkit")) is 1 then
tell application "WebKit" to make new document
end if