Skip to content

Instantly share code, notes, and snippets.

View bevacqua's full-sized avatar

Nicolás Bevacqua bevacqua

View GitHub Profile
@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 / 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
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) {

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
» brew install graphicsmagick -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
==> Downloading https://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/1.3.19/GraphicsMagick-1.3.19.tar.bz2
Already downloaded: /Library/Caches/Homebrew/graphicsmagick-1.3.19.tar.bz2
==> Verifying graphicsmagick-1.3.19.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/graphicsmagick-1.3.19.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/graphicsmagick/1.3.19_1 --disable-dependency-tracking --enable-shared --disable-static --with-modules --disable-openmp --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-x --without-lcms --without-lcms2
configuring GraphicsMagick 1.3.19
checking build system type... x86_64-apple-darwin13.1.0

Keybase proof

I hereby claim:

  • I am bevacqua on github.
  • I am bevacqua (https://keybase.io/bevacqua) on keybase.
  • I have a public key whose fingerprint is B696 45CC A13B 5A14 8F22 9DC6 A894 3128 66B0 00E1

To claim this, I am signing this object:

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@bevacqua
bevacqua / slug.js
Last active August 29, 2015 14:02
var rinvalid = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;
var raccents = /[\xC0-\xFF]/g;
var accents = [
[/[\xC0-\xC5]/g, 'A'],
[/[\xC6]/g, 'AE'],
[/[\xC7]/g, 'C'],
[/[\xC8-\xCB]/g, 'E'],
[/[\xCC-\xCF]/g, 'I'],
[/[\xD0]/g, 'D'],
[/[\xD1]/g, 'N'],