Skip to content

Instantly share code, notes, and snippets.

@chapel
chapel / jsx.jsx
Last active January 2, 2016 15:19
<html data-reactid=".r[5sfzg]" data-react-checksum="1010059815"><head data-reactid=".r[5sfzg].[0]"></head><body data-reactid=".r[5sfzg].[1]"><div data-reactid=".r[5sfzg].[1].[0]">context</div><div data-reactid=".r[5sfzg].[1].[1]">baz</div></body></html>
/usr/local/lib/node_modules/cipherhub/node_modules/rsa-stream/node_modules/ursa/lib/ursa.js:291
return encodeBuffer(rsa.privateDecrypt(buf, padding), outEncoding);
^
Error: error:0407A079:rsa routines:RSA_padding_check_PKCS1_OAEP:oaep decoding error
at Object.decrypt (/usr/local/lib/node_modules/cipherhub/node_modules/rsa-stream/node_modules/ursa/lib/ursa.js:291:33)
at Through2._transform (/usr/local/lib/node_modules/cipherhub/node_modules/rsa-stream/index.js:37:27)
at Through2.Transform._read (_stream_transform.js:179:10)
at Through2.Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:221:10)
at writeOrBuffer (_stream_writable.js:211:5)
@chapel
chapel / blah.js
Last active December 22, 2015 18:49
var fn = function* (args) {
yield asyncFn(args);
};
Object.defineProperty(this, 'fn', {
get: function () {
return function () {
return fn.next();
}
}
@chapel
chapel / base.js
Last active December 21, 2015 05:58 — forked from anonymous/gist:6260605
exports.searchContactPost = function(req, res) {
if(req.body.searchContacts === '') { res.send('Oops you searching for nothing, well here is nothing!'); };
async.waterfall([
function(callback) {
User.find({$or:[
{firstName: req.body.searchContacts.toLowerCase()},
{lastName: req.body.searchContacts.toLowerCase()},
{email: req.body.searchContacts.toLowerCase()}]
}, function(err, users) {
if(err || users.length === 0) { res.send(err);}
var async = require('async');
function getUserFriends(userName, next) {
db.users.findOne({name:userName}, foundUser);
var glob = {};
function foundUser(err, user) {
if (err != null) return next(err);
[13:58:05 PM] <|oo|> Is this wiki page up-to-date? http://www.codeux.com/textual/wiki/Writing-Scripts.wiki ..claims custom script dir is ~/Library/Application Scripts/com.codeux.irc.textual but Textual prefs opens ~/Library/Containers/com.codeux.irc.textual/Data/Library/Application Scripts/com.codeux.irc.textual as custom addons dir
[13:58:33 PM] <|oo|> scripts in the former don't seem to be picked up by textual (and honestly I can't get them to work anywhere)
[13:59:52 PM] <|oo|> always says "Script Execution Failure: Script file is not in the application scripts folder." (using the example.scpt applescript from the wiki)
[14:02:18 PM] <chapel> |oo|: as long as they are in ~/Library/Application Scripts/com.codeux.irc.textual they seem to work for me
[14:03:14 PM] <chapel> and the latter location you listed is just a symlink
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