This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.AttributeSearchResultView = Backbone.View.extend({ | |
tagName: 'li', | |
events: { | |
'click': 'addAttribute' | |
}, | |
addAttribtue: function() { | |
console.log('added'); | |
}, | |
initialize: function() { | |
this.template = _.template($('#attributeSearchResult-template').html()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var GoSquared = {}; | |
GoSquared.acct = "GSN-889229-P"; | |
(function(w){ | |
function gs(){ | |
w._gstc_lt = +new Date; | |
var d = document, g = d.createElement("script"); | |
g.type = "text/javascript"; | |
g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js"; | |
var s = d.getElementsByTagName("script")[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (pop lis) | |
(define (r a b) | |
(if (= (length b) 1) | |
a | |
(r (cons a (car b)) (cdr b)) | |
)) | |
(cond | |
((NULL? lis) '()) | |
((= (length lis) 1) '()) | |
(else (r (car lis) (cdr lis))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (odds lis) | |
(reverse (odds-reduce lis '()))) | |
(define (odds-reduce l1 l2) | |
(cond | |
((null? l1) l2) | |
((= (length l1) 1) (cons (car l1) l2)) | |
(else (odds-reduce (cddr l1) (cons (car l1) l2))) | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function update(path, val, obj) { | |
(function r(keys, o) { | |
if (keys.length > 1) { | |
var current = keys.shift(); | |
if (!o[current]) | |
o[current] = isNaN(parseInt(keys[0])) ? {} : []; | |
r(keys, o[current]); | |
} else { | |
o[keys[0]] = val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB.prototype.updateTodo = function(id, val, fn) { | |
this.db.collection('todo').update({ _id : id }, val, function(err) { | |
if (err) return fn(err); | |
console.log(arguments); | |
fn(null); | |
}); | |
}; | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function.prototype.bind = function(thisObj) { | |
var that = this; | |
return function() { | |
return that.apply(thisObj, arguments); | |
}; | |
}; | |
function fn() { | |
return this; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reduce(obj, iterator, memo, ctx) { | |
var keys = Object.keys(obj), | |
memo = memo || obj[keys[0]]; | |
ctx = ctx || null; | |
for (var i = arguments[2] ? 0 : 1; i < keys.length; i++) | |
memo = iterator.call(ctx, memo, obj[keys[i]], keys[i], obj); | |
return memo; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change command prefix binding | |
unbind C-b | |
set -g prefix C-a | |
# decrease command-sending delay | |
set -sg escape-time 1 | |
# make window and pane index one-based | |
set -g base-index 1 | |
setw -g pane-base-index 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pg = require(‘pg’), connString = ‘***’; | |
function DB(cb) { | |
var that = this; | |
pg.connect(connString, function(err, client, done) { | |
if (err) return cb(err); | |
that.client = client; | |
cb(null, that); | |
}); | |
} |