Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
@drudge
drudge / init.pp
Created June 25, 2012 17:17
Node.js Puppet Module
class nodejs ( $version, $logoutput = 'on_failure' ) {
$nave_path = '/usr/local/bin/nave'
$nave_dir = '/usr/local/lib/nave'
package { 'bash':
ensure => present,
}
package { 'curl':
ensure => present,
@domenic
domenic / 1-index.html
Last active October 7, 2015 05:27
Proof of concept of ES5 data binding
<!DOCTYPE html>
<html>
<head>
<title>ES5 Data Binding Proof of Concept</title>
</head>
<body>
<section>
<label>
Name:
<input data-bind="name" type="text" />
@gnclmorais
gnclmorais / statusCodes.js
Created July 20, 2012 20:26
HTTP Statuses Codes for JavaScript
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Inspired by Filipe Kiss' protip (http://coderwall.com/p/o2hpka), *
* I decided to port his PHP variable to JavaScript. *
* Do whatever you want with this. Enjoy. Full credit to Filipe. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var status = {
100: 'HTTP/1.1 100 Continue',
101: 'HTTP/1.1 101 Switching Protocols',
@danro
danro / Custom.css
Created September 16, 2012 17:32
Improved webkit inspector toolbar
#-webkit-web-inspector #toolbar {
background: #cdcdcd !important;
height: 36px !important;
}
#-webkit-web-inspector #main {
top: 36px !important;
}
#-webkit-web-inspector .toolbar-item.elements:hover:after {
content: "elements";
z-index: 9999;
@millermedeiros
millermedeiros / updateLibs.sh
Last active October 11, 2015 12:37
Shell script to update 3rd party libs
#!/bin/sh
# This shell script is used to bootstrap the app and update external libraries
#
# ====== IMPORTANT ======
#
# it may break application if 3rd party libs aren't backwards compatible
# or if libs were edited locally, use with care !!!
@asciidisco
asciidisco / dalekme.md
Last active December 17, 2015 04:08
Overview about DalekJS ressources (Try ing to keep it up to date)
@polotek
polotek / event_emitter_example.js
Last active December 17, 2015 22:59
Simple example of a node event emitter
// Grab the EventEmitter constructor. events is a core node module.
var Emitter = require('events').EventEmitter;
// Our internal function will generate random numbers
function randomInt(limit) {
return Math.ceil( Math.random() * limit );
}
module.exports = function(limit) {
if(!(limit && limit > 0)) {
@johnkpaul
johnkpaul / editor.js
Created June 4, 2013 12:51
Who needs text editors? I write JavaScript
node -e 'process.stdin.pipe(require("fs").createWriteStream(process.argv[1]))' FILENAME
@mikeal
mikeal / gist:6685843
Last active December 23, 2015 19:58
Response to comments by Issac Roth of StrongLoop

This is rather out of date and we've all moved past it. Me and Issac are cool now.

pic

@nzakas
nzakas / gist:7015508
Created October 16, 2013 21:48
Async event emitter

What I'm considering for an async event emitter is a situation like this:

  1. I want to be able to fire events before something happens and after something happens.
  2. Each of the event handlers may do an async process.
  3. I need to know after all of the "before" event handlers have completed before doing the actual action that I'm saying will happen.

A synchronous example would look like:

emitter.emit('beforewrite');