Skip to content

Instantly share code, notes, and snippets.

_.filter(um.stack.where({type: 'change'}), function (model) {
return !model.get('after')._id
});
Animal = (function() {
function Animal(name) {
this.name = name;
}
Animal.prototype.move = function(meters) {
return alert(this.name + (" moved " + meters + "m."));
};
return Animal;
var stylus = require('stylus');
var send = require('koa-send');
exports.get = function *(next) {
this.root = process.cwd() + '/app';
yield stylus
.middleware(this.root)
.bind(null, this.req, this.res);
yield next;
yield send(this, this.path, {root: this.root});
{
"exclude": [
".git/**",
"node_modules/**"
],
"always-semicolon": true,
"block-indent": " ",
"colon-space": ["", " "],
"color-case": "upper",
"color-shorthand": true,
@A
A / skype
Created July 13, 2014 11:27
/showplaces - показывает с каких устройств вы залогинены
/remotelogout - после этой команды Skype выходит со всех устройств, кроме текущего
{
"exclude": [
".git/**",
"node_modules/**"
],
"always-semicolon": true,
"block-indent": " ",
"colon-space": ["", " "],
"color-case": "upper",
"color-shorthand": true,
function debounce(cb, timeout) {
var timer;
return function () {
timer && clearTimeout(timer);
timer = setTimeout(function () {
cb.apply(this, arguments);
}, timeout);
}.bind(this);
}
@A
A / pkgcount.sh
Last active August 29, 2015 14:04
# npm i -g pkgcount
➜ pkgcount --duplicates -s
options.sortKey duplicates
NAME COUNT
[email protected] 2
[email protected] 2
[email protected] 2
[email protected] 2
[email protected] 2
➜ ~ cat ~/.dotfiles/bin/dotfiles-test
#!/bin/bash
echo 'hello world'
➜ ~ echo $PATH
/usr/local/share/npm/bin/:~/.dotfiles/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
➜ ~ dotfiles-test
zsh: command not found: dotfiles-test
➜ ~ bash
bash-3.2$ source .exports
@A
A / irverbs.js
Last active August 29, 2015 14:04
// http://www.usingenglish.com/reference/irregular-verbs/
var irverbs = [];
$('.irregverbs tr').toArray().slice(1).forEach(function(e) {
var item = [];
item.push($(e).find('a strong').text());
$(e).find('td').toArray().slice(1).forEach(function(e) { item.push($(e).text()) });
irverbs.push(item);
});
console.dir(irverbs)