start new:
tmux
start new with session name:
tmux new -s myname
var express = require('express') | |
, app = express() | |
, server = require('http').createServer(app) | |
, io = require('socket.io').listen(server) | |
, fs = require('fs') | |
, path = require('path') | |
, gpio = require('rpi-gpio') | |
server.listen(8000); |
# QBD Integration | |
gem "wash_out", "0.9.0" | |
gem 'qbxml', '~> 0.1.5' |
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
) | |
var payload = ` | |
<ns:workItem> | |
<typ:correspondenceCount>10</typ:correspondenceCount> |
package main | |
import ( | |
"log" | |
"bufio" | |
"time" | |
"os" | |
"fmt" | |
"io" | |
"net" |
// http://deploytonenyures.blogspot.fr/2015/11/es6-proxies-part-ii.html | |
//to run it in node.js 4 it should be just this flag: --harmony_proxies | |
//but does not seem to work, so run it in Firefox | |
var cat = { | |
name: "Kitty", | |
method1: function(msg){ | |
console.log("cat: " + this.name + ", method1 invoked with msg: " + msg); | |
this.method2(msg); | |
}, |
sudo su - | |
# Kernels older than 3.10 lack some of the features required to run Docker containers. | |
uname -r | |
3.11.0-15-generic | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list |
{ | |
"AWSEBDockerrunVersion": "1", | |
"Image": { | |
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>", | |
"Update": "true" | |
}, | |
"Ports": [ | |
{ | |
"ContainerPort": "443" | |
} |
// Since ES6 Map()'s' retain their order of insertion, it can sometimes be useful to get the last item or value inserted: | |
export const getLastItemInMap = map => Array.from(map)[map.size-1] | |
export const getLastKeyInMap = map => Array.from(map)[map.size-1][0] | |
export const getLastValueInMap = map => Array.from(map)[map.size-1][1] | |
// Obviously getLastKey and getLastValue can reuse getLastItem, but for maximum portability I opted for verbosity. |
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"net" | |
"os" | |
"github.com/go-sql-driver/mysql" | |
"golang.org/x/crypto/ssh" |