Skip to content

Instantly share code, notes, and snippets.

View mongris's full-sized avatar

M mongris

  • Auckland, New Zealand
View GitHub Profile
@mongris
mongris / gist:4dbd0a9b7f0c5dcd741d
Last active September 2, 2015 23:26 — forked from danielgtaylor/gist:0b60c2ed1f069f118562
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mongris
mongris / boot.js
Last active August 29, 2015 14:07 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run

If you encounter errors like this ``fatal error: 'stdlib.h' file not foundon Yosemite and Xcode 6.0.1, your/usr/include/` is probably missing.

Try this command on Terminal:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include /usr/include

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

input {
file {
type => syslog
path => "/var/log/messages"
}
}
filter {
grok {
type => syslog
description "logstash collector server"
start on runlevel [2345]
stop on runlevel [06]
# tell upstart we're creating a daemon
# upstart manages PID creation for you.
expect fork
script
@mongris
mongris / kibana.conf
Last active December 19, 2015 13:59 — forked from technosophos/kibana.conf
# kibana.conf# kibana - log viewer
#
description "Kibana logstash viewer"
start on virtual-filesystems
stop on runlevel [06]
respawn
respawn limit 5 30
input {
file {
type => nginx_web
path => ["/var/log/nginx/*"]
exclude => ["*.gz"]
}
}
filter {
grok {