Skip to content

Instantly share code, notes, and snippets.

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)
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) {
var RedisClient = require('redis').RedisClient;
var util = require('util')
var CustomClient = function () {
RedisClient.call(this)
}
util.inherit(CustomClient, RedisClient);
// Extend CustomClient here
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
div blah
//
comment
new line still comment
still comment
div not comment
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)
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', '');
<form name="search" action="/search">
<input type="text" name="query" value="">
</form>
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]
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)
})