This file contains hidden or 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 Foo = Ember.Object.extend({zerb: function () {}}); | |
undefined | |
var bar = Foo.create(); | |
undefined | |
JSON.stringify(bar); | |
"{}" | |
bar.set('asdf', 'ASDF'); | |
Class {asdf: "ASDF", __ember1458770221107: null, __nextSuper: undefined, __ember_meta__: Object} | |
JSON.stringify(bar); | |
"{"asdf":"ASDF"}" |
This file contains hidden or 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 filterGhNotifications() { | |
var sourceLabel = GmailApp.getUserLabelByName('GH'); | |
var addedLabel = GmailApp.getUserLabelByName('GH -- mde'); | |
var pat = /@mde/; | |
var threads; | |
var foundThreads = []; | |
threads = sourceLabel.getThreads(0, 20); | |
threads.forEach(function (thread) { | |
var messages = thread.getMessages(); | |
var subject; |
This file contains hidden or 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 iterativeRunner = function (arr) { | |
var funcs = arr.map(function (item, index) { | |
return function () { | |
item(function () { | |
if (funcs[index + 1]) { | |
funcs[index + 1](); | |
} | |
}); | |
}; | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Mixin.create({ | |
_sendActionPropagateChannel: '_sendActionPropagateChannel', | |
actions: { | |
_sendActionPropagateChannel: function () { | |
try { | |
this.send.apply(this, arguments); | |
} | |
catch (err) { |
This file contains hidden or 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 foo = { | |
a: function () { | |
console.log(this); | |
} | |
}; | |
foo.a(); // Logs the foo obj | |
foo['a'](); // Same, logs the foo obj |
This file contains hidden or 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 foo = function (seed) { | |
var currVal = seed; | |
var incrementor = function () { | |
currVal++; | |
console.log(currVal); | |
}; | |
return incrementor; | |
}; |
This file contains hidden or 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 mixin = function () { | |
var args = Array.prototype.slice.call(arguments); | |
var target = args.shift(); | |
var source = args.shift(); | |
// We don't need no hasOwnProperty checks! | |
for (var prop in source) { | |
target[prop] = source[prop]; | |
} | |
if (args.length) { | |
args.unshift(target); |
This file contains hidden or 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 foo = function (a) { return function (b) { return a * b; }; }; | |
undefined | |
> var bar = foo(2); | |
undefined | |
> bar(5); | |
10 | |
> var foo = function () { console.log(arguments.length); }; | |
undefined | |
> foo(); | |
0 |
This file contains hidden or 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 http = require('http') | |
, domain = require('domain') | |
, riakpbc = require('./index') | |
, riak = riakpbc.createClient({host: 'localhost', port: 8087}); | |
http.createServer(function (req, res) { | |
var dmn = domain.create(); | |
dmn.on('error', function (err) { | |
console.dir(arguments); |
This file contains hidden or 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
bash-3.2$ npm install | |
npm http GET https://registry.npmjs.org/filelist | |
npm http GET https://registry.npmjs.org/minimatch/0.2.3 | |
npm http 200 https://registry.npmjs.org/filelist | |
npm http GET https://registry.npmjs.org/filelist/-/filelist-0.0.2.tgz | |
npm http 200 https://registry.npmjs.org/minimatch/0.2.3 | |
npm http GET https://registry.npmjs.org/minimatch/-/minimatch-0.2.3.tgz | |
npm http 200 https://registry.npmjs.org/filelist/-/filelist-0.0.2.tgz | |
npm WARN package.json [email protected] No README.md file found! | |
npm http 200 https://registry.npmjs.org/minimatch/-/minimatch-0.2.3.tgz |
NewerOlder