Skip to content

Instantly share code, notes, and snippets.

View bevacqua's full-sized avatar

Nicolás Bevacqua bevacqua

View GitHub Profile
function flow (generator) {
var iterator = generator(next);
next();
function next (err, result) {
if (err) {
iterator.throw(err);
}
var item = iterator.next(result);
if (item.done) {
function flow (generator) {
var iterator = generator(next);
next();
function next (err, result) {
if (err) iterator.throw(err);
var item = iterator.next(result);
if (item.done) return;
if (typeof item.value === 'function') item.value(next);
}
}
function flow (generator) {
var iterator = generator(next);
next();
function next (err, result) {
if (err) iterator.throw(err);
var item = iterator.next(result);
if (item.done) return;
if (typeof item.value === 'function') item.value(next);
@bevacqua
bevacqua / sublime-pc.sh
Created March 4, 2014 03:24
Install Package Control in your shell rather than pasting weird stuff into Sublime Text.
curl https://sublime.wbond.net/Package%20Control.sublime-package \
-o ~/Library/Application\ Support/Sublime\ Text\ 3/Installed\ Packages/Package\ Control.sublime-package
data:text/html,<img src='https://pbs.twimg.com/media/BgbgCfLIAAA4Qkj.jpg:large' style='display:block;margin:auto;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)'/>
@bevacqua
bevacqua / pluck.js
Created February 7, 2014 16:00
Declarative variable names make for such readable code!
function pluck (a, prop) {
return a.map(function (a) { return a[prop]; });
}
@bevacqua
bevacqua / gulp-npm-publish.js
Created January 18, 2014 16:22
Publish packages to `npm` using Gulp.
var spawn = require('child_process').spawn;
gulp.task('npm', function (done) {
spawn('npm', ['publish'], { stdio: 'inherit' }).on('close', done);
});
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
server {
listen 80;
server_name konklone.com;
return 301 https://$host$request_uri;
}
# optional: the 'spdy' at the end of the listen command below turns on SPDY support.
server {
listen 443 ssl spdy;