My Recent Pastes (271 and counting)
Pastes by James Gray (271 and counting)
Below are the 15 most recent pasties by James Gray.
September 13, 2010
2:43PM EDT
by James Gray
View all 7 lines
trap("INT") do puts "Exiting..." exit end
May 28, 2010
8:24PM EDT
by James Gray
View all 27 lines
FILE = "classes.marshal" if File.exist? FILE begin p File.open(FILE, "rb") { |file| Marshal.load(file) } rescue ArgumentError => error
May 21, 2010
11:10PM EDT
by James Gray
View all 22 lines
#!/usr/bin/env ruby -wKU require "benchmark" TESTS = 1_000_000
February 23, 2010
12:17PM EDT
by James Gray
View all 6 lines
class ActionController::Base protected def request_origin @request_origin ||= "#{request.remote_ip} at #{Time.now.utc.to_s(:db)}" end
December 02, 2009
2:15PM EDT
by James Gray
View all 28 lines
#!/usr/bin/env ruby -wKU require "benchmark" class Whatever
November 29, 2009
5:58PM EDT
by James Gray
View all 59 lines
basic_block {}
basic_block { }
basic_block { }
block_with_args {|var|}
November 25, 2009
3:02PM EDT
by James Gray
View all 22 lines
[
{ // start db 0
"key1": {"type":"string","value":"value1"},
"key2": {"type":"list","expire":1259178126,"value":[
"a",
November 10, 2009
6:32PM EDT
by James Gray
View all 14 lines
#!/usr/bin/env ruby -wKU require "rubygems" require "ffi"
November 02, 2009
7:54PM EDT
by James Gray
View all 410 lines
#!/usr/bin/env ruby -wKU require "strscan" module BASIC
September 22, 2009
7:16PM EDT
by James Gray
View all 12 lines
#!/usr/bin/env ruby -KU require "rubygems" require "rufus/tokyo"
September 21, 2009
10:34PM EDT
by James Gray
View all 26 lines
#!/usr/bin/env ruby -KU require "rubygems" require "rufus/tokyo"
August 31, 2009
9:14AM EDT
by James Gray
View all 13 lines
#!/usr/bin/env ruby -wKU require "rubygems" require "rufus/edo"
August 20, 2009
8:51AM EDT
by James Gray
View all 10 lines
%w[ database names here ].each do |name| command = "mysqldump #{name}_development > #{name}_development.sql" puts command
August 13, 2009
6:22PM EDT
by James Gray
View all 6 lines
require "rubygems" require "rufus/edo" store = Rufus::Edo::Cabinet.new("data.tch") store["hello"] = "world"
July 29, 2009
11:55AM EDT
by James Gray
View all 27 lines
commit 4ae744e8d6908cbcb1ef5bb93321c055bc1c3b06 Author: James Edward Gray II <james@graysoftinc.com> Date: Fri Jul 10 17:18:58 2009 -0500 Fixing the overeagerness of the Ruby 1.9 Symbol syntax matcher. It doesn't support the same range of Symbols as the older syntax does.
