#Git extras how-to
Transcript from http://vimeo.com/45506445
sudo apt-get install git-extras
#Git extras how-to
Transcript from http://vimeo.com/45506445
sudo apt-get install git-extras
var irc = require('irc'); | |
var client = new irc.Client('chat.freenode.net', 'osk-bot2', { | |
channels: ['#taringa'], | |
}); | |
client.addListener('message', function (from, to, message) { | |
console.log("From %s: %s", from, message); | |
if (message === "osk-bot go!" && from === "osk") { | |
client.say("#taringa", "Roger that !"); |
# PUTH THIS IN ~/.bash_aliases | |
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
Whether you use 2 spaces or 4 spaces, there are a few simple things that can make your node.js code easier to read. We've been using them in all the hapi modules for over 4 years now to great results. This list is by no means complete but it highlights the most useful elements that will give you immediate value in reducing bugs.
JavaScript makes is harder than most languages to know where variables are coming from. Variables assigned required modules are particularly important because they represent a singleton object shared with the entire application. There are also globals and module globals, along with function variables and arguments.
Traditionally, variables starting with an uppercase letter represent a class that must be instantiated using new
. This was an important semantic in the early days of JavaScript but at this point, if you don't know Date
requires new Date()
you are probably very new. We have adopted CamelCase variable names for all module global variables which a
// $ npm install shelljs | |
// | |
require("shelljs/global"); | |
var scripts = [ "./script1.sh", "./script2.sh", "./script3.sh" ]; | |
scripts.forEach(function(s) { | |
// Este exec es exportado en el scope global por shelljs | |
// Es sincrónico. | |
if (exec(s).code !== 0) { |
# include these first in your scripts | |
yell() { echo "$0: $*" >&2; } | |
die() { yell "$*"; exit 111; } | |
try() { "$@" || die "cannot $*"; } |
require("babel/register"); | |
setTimeout(()=> { | |
console.log("hola"); | |
}); |
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"es6": true, | |
"mocha": true, | |
"node": true | |
}, | |
"ecmaFeatures": { | |
"jsx": true, |
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "Please provide a filename/dirname from calypso as first parameter" | |
exit | |
fi | |
if [ -z "$2" ] | |
then | |
echo "Please provide a destination directory" |
docker run --rm -it -v $(pwd):/jetpack -w /jetpack --name jetpack node:6 /bin/bash -c "rm /usr/local/bin/yarn && apt-get update && apt-get -y install php5-cli && curl -s -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.17.9 && PATH=/root/.yarn/bin:$PATH bash -c 'yarn distclean && yarn build'" |