I hereby claim:
- I am jtompkins on github.
- I am jtompkins (https://keybase.io/jtompkins) on keybase.
- I have a public key whose fingerprint is 7EDE 61F3 187D 39F1 14A1 55A8 B452 25A8 1076 E60D
To claim this, I am signing this object:
// taken from http://www.dreamincode.net/code/snippet154.htm | |
// | |
// Find the weaknesses, and clean up the code. | |
// Find at least 3 things you can make better! | |
// | |
// Test numbers (return true): | |
// 4111111111111111 | |
// 378282246310005 | |
// 5555555555554444 |
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
function(container) { | |
var index; | |
function log(){ | |
console.log(index); |
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
// Code | |
function(container) { | |
var index; | |
function log(){ | |
console.log(index); |
var b = new QueryBuilder(); | |
var select = b.Select(columns: "id, name, price", from: "products", as: "p"); | |
var select2 = b.Select(columns: "id, discount, name", from: "sales", as: "s"); | |
b.Join(left: select, right: select2, on: new { s: "productId", p: "Id", operation: Operations.Equals }); | |
//or | |
b.LeftOuterJoin(left: select, right: select2, on: new { s: "productId", operation: Operations.Equals, p: "Id }); | |
select.Where(column: "name", operation: Operations.Equals, value: "josh"); |
class Messenger | |
constructor: -> | |
@subs = {} | |
register: (type, caller, func) => | |
return unless type? and caller? and func? | |
@subs[type] = [] unless @subs[type]? | |
existing = null |
<script type="text/javascript"> | |
function createColumn() { | |
return $('<div class="column"></div>'); | |
} | |
function createBlock() { | |
return $('<div class="block"></div>'); | |
} | |
function isLarge(tile) { |
I hereby claim:
To claim this, I am signing this object:
# A weird, mostly ugly, kind of functional-programming-ish solution | |
# to RubyQuiz #117: | |
# http://rubyquiz.com/quiz117.html | |
STATES = { | |
vacuum: " ", | |
vapor: ".", | |
frost: "*" | |
} |
require_relative '../../lib/action' | |
require_relative '../../lib/store' | |
Todo = Struct.new(:text, :completed) | |
class CommandProcessor | |
def parse_command(text) | |
command_array = text.split(' ') | |
case command_array[0] |
class ARepository | |
extend Codependent::Helper | |
singleton :a_repository, in_scope: :a_test_scope do | |
with_constructor { ARepository.new } | |
depends_on :logger, :another_repository | |
end | |
attr_accessor :logger, :another_repository | |
end |