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
async(1, cb) | |
function cb(err, res) { | |
if (err) return done(err) | |
async2(res.blah, cb2) | |
} | |
function cb2(err, res) { | |
if (err) return done(err) | |
async3(res.foo, cb3) |
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 empty_list = function(selector) { | |
return selector(undefined, undefined, true); | |
}; | |
var prepend = function(el, list) { | |
return function(selector) { | |
return selector(el, list, false); | |
}; | |
}; | |
var head = function(list) { |
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 RedisClient = require('redis').RedisClient; | |
var util = require('util') | |
var CustomClient = function () { | |
RedisClient.call(this) | |
} | |
util.inherit(CustomClient, RedisClient); | |
// Extend CustomClient here |
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 albumIds = [] | |
var albums = pin.photos.map(function(photo){ | |
albumIds.push(photo.albumId) | |
return { | |
albumId: photo.albumId, | |
albumTitle: photo.albumTitle | |
}; | |
}) | |
// Alternative to avoid empty elements and duplicates |
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
div blah | |
// | |
comment | |
new line still comment | |
still comment | |
div not comment |
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 arr = [1, 2, 3, 4, 5, 6, 7, 8] | |
, highest | |
for (var i = 0; i < arr.length; i+=1) { | |
if (i === 0) highest = arr[i] | |
if (highest < arr[i]) highest = arr[i] | |
} | |
console.log(highest) |
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
1,2c1,3 | |
< CREATE TYPE check_parent_table AS (parent_table text, count bigint); | |
< CREATE TABLE part_config ( | |
--- | |
> CREATE SCHEMA partman; | |
> CREATE TYPE partman.check_parent_table AS (parent_table text, count bigint); | |
> CREATE TABLE partman.part_config ( | |
21,22c22,23 | |
< CREATE INDEX part_config_type_idx ON @extschema@.part_config (type); | |
< SELECT pg_catalog.pg_extension_config_dump('part_config', ''); |
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
<form name="search" action="/search"> | |
<input type="text" name="query" value=""> | |
</form> |
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
State: - pip | |
Name: pagerduty | |
Function: installed | |
Result: False | |
Comment: An exception occured in this state: Traceback (most recent call last): | |
File "/vagrant/srv/salt/salt-github/salt/state.py", line 824, in call | |
ret = self.states[cdata['full']](*cdata['args']) | |
File "/vagrant/srv/salt/salt-github/salt/states/pip.py", line 100, in installed | |
version = list(pkg_list.values())[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
var redis = require('redis') | |
var c = redis.createClient(null, null, {return_buffers:true}) | |
c.lpush('foobar', new Buffer('foobar')) | |
c.rpop('foobar', function (err, res) { | |
console.log(res) | |
}) |