viscosity connect <vnp-name>
viscosity disconnect <vpn-name>
function ready (fn) { | |
if (typeof fn !== 'function') return | |
if (document.readyState === 'complete') return fn() | |
document.addEventListener('DOMContentLoaded', fn, false) | |
} |
function bufferFrom (stream, fn, {concat} = Buffer) { | |
return buffer = [] | |
, stream.on('data', (data) => buffer.push(data)) | |
.on('end', () => fn(concat(buffer))) | |
} |
const _require = ([module]) => require(module) | |
// usage | |
const {join, resolve} = _require `path` |
$ telnet 104.20.23.46 80 | |
Trying 104.20.23.46... | |
Connected to 104.20.23.46. | |
Escape character is '^]'. | |
HEAD /dist/v7.4.0/node-v7.4.0-darwin-x64.tar.gz HTTP/1.1 | |
Host: nodejs.org | |
Accept: */* | |
HTTP/1.1 200 OK |
const {Readable, PassThrough} = require('stream') | |
const {createReadStream} = require('fs') | |
const {ok, equal} = require('assert') | |
describe('toString', function(){ | |
it('converts a fs-stream to buffer', done => { | |
let stream = createReadStream('/dev/null') | |
toString(stream, function(string){ |
#!/usr/bin/env node | |
const {mkdirSync:mkdir} = require('fs') | |
const {dirname} = require('path') | |
function mkdirp(path, mode = 0777){ | |
try { | |
mkdir(path, mode) | |
} catch({errno}) { | |
if (-2 !== errno) return // enoent |
My name is Ivo and I am an Italian agile software developer who loves coding and solving problems in a simple yet creative fashion. During my years of web development I have grown a strong passion for fronted development which led me to a good understanding of its underlaying technologies. I love hacking the hell out of web apps and getting a grasp of cutting edge technologies in order to keep up with time and deliver the best user experience possible.
While user experience still plays a big role in what I enjoy doing, I've learnt how important it is to write stable yet maintainable and scalable backend solutions. Even though I started out with PHP, I soon naturally came closer to the NodeJS environment while still embracing more "elegant" technologies such as Ruby or Java either adopting frameworks or by implementing architectures from scratch.
I discovered the Agile Manifesto and eXtreme Programming back while joining XPeppers in 2013 and I’ve tried my best to apply either values and prin
cd ~/Downloads | |
git clone --recursive https://github.com/vysheng/tg.git | |
cd tg | |
brew install libconfig readline lua python libevent jansson openssl | |
brew link --force openssl | |
brew link --force readline | |
export CFLAGS="-I/usr/local/include -I/usr/local/Cellar/readline/6.3.8/include" | |
export LDFLAGS="-L/usr/local/lib -L/usr/local/Cellar/readline/6.3.8/lib" | |
./configure --disable-liblua && make |
const http = require('http') | |
http.createServer((req, res) => { | |
console.log('-- url:', req.url) | |
console.log('-- verb:', req.method) | |
let body = [] | |
req.on('data', function(chunk) { | |
body.push(chunk) | |
}).on('end', function() { | |
console.log('-- body:', Buffer.concat(body).toString()) |