Skip to content

Instantly share code, notes, and snippets.

/* Implementation by Jesse Phelps & Tomasz Mozolewski */
DECLARE @maxGen int
set @maxgen = (select MAX(generation) from Cells)
--insert into cells
;WITH cte AS
(
(= [[:top :left] [:top :middle] [:top :right]
[:middle :left] [:middle :middle] [:middle :right]
[:bottom :left] [:bottom :middle] [:bottom :right]]
(for [row [:top :middle :bottom] column [:left :middle :right]]
[row column])))
[:top, :middle, :bottom].product [:left, :middle, :right]
# produces
[[:top, :left], [:top, :middle], [:top, :right],
[:middle, :left], [:middle, :middle], [:middle, :right],
[:bottom, :left], [:bottom, :middle], [:bottom, :right]]
def run_it
system('sh run.sh')
end
run_it
watch( 'src/koans/.*\.clj' ) { run_it }
def js_command(command)
"-e 'do JavaScript \"#{command}\" in first document'"
end
def reload
js_command("window.location.reload();")
end
def scroll
js_command("window.scrollTo(0, document.body.scrollHeight);")
def run
system("clear;rake")
end
run
watch("koans/\.*\.rb") { run }
(1..100).each do |num|
out = num % 3 == 0 ? 'Fizz' : ''
out << 'Buzz' if num % 5 == 0
out = num if out.size == 0
print out
end
var counter1 = 0, counter2 = 0;
var i,j,l,ll;
var single = new Array(1000000);
var double = new Array(1000);
for(i = 0, l = double.length; i < l; i = (i + 1)) {
double[i] = new Array(1000);
}
var start = new Date();
require 'rubygems'
require 'irb/completion'
require 'ap'
unless IRB.version.include?('DietRB')
IRB::Irb.class_eval do
def output_value
ap @context.last_value
end
end
Autotest.add_hook(:initialize) do |at|
at.add_exception(%r{vendor/cache})
at.add_mapping(%r%^vendor/engines/proposals/spec/(models|controllers|routing|views|helpers|mailers|requests|lib)/.*rb$%) { |filename, _|
filename
}
at.add_mapping(%r%^vendor/engines/proposals/app/models/(.*)\.rb$%) { |_, m|
["vendor/engines/proposals/spec/models/#{m[1]}_spec.rb"]
}
at.add_mapping(%r%^vendor/engines/proposals/app/views/(.*)$%) { |_, m|