Skip to content

Instantly share code, notes, and snippets.

View jtompkins's full-sized avatar

Joshua Tompkins jtompkins

View GitHub Profile
@jtompkins
jtompkins / gist:3927218
Created October 21, 2012 15:08
Just a little project I'm working on...
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");
// 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);
// 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