I hereby claim:
- I am sandinmyjoints on github.
- I am sandinmyjoints (https://keybase.io/sandinmyjoints) on keybase.
- I have a public key whose fingerprint is DCAF AC85 B9BC 9906 2005 936A 3837 B7C0 EC44 F56A
To claim this, I am signing this object:
#! /usr/bin/env node | |
/*eslint no-console: 0*/ | |
const dgram = require('dgram'); | |
const server = dgram.createSocket('udp4'); | |
server.on('error', (err) => { | |
console.log(`server error:\n${err.stack}`); | |
server.close(); | |
}); |
I hereby claim:
To claim this, I am signing this object:
{ | |
"plugins": [ | |
"prettier" | |
], | |
"extends": [ | |
"eslint:recommended", | |
"prettier" | |
], | |
"env": { | |
"es6": true, |
'use strict'; | |
let http = require('http'); | |
let reqOpts = { | |
host: 'sdlocal.com', | |
port: 2100, | |
path: '/' | |
} | |
let req = http.request(reqOpts) |
# See http://www.markhneedham.com/blog/2013/07/30/netcat-strange-behaviour-with-udp-only-receives-first-packet-sent/ | |
nc -u -l 8125 -w 0 -k |
const dgram = require('dgram'); | |
const server = dgram.createSocket('udp4'); | |
server.on('error', (err) => { | |
console.log(`server error:\n${err.stack}`); | |
server.close(); | |
}); | |
server.on('message', (msg, rinfo) => { | |
console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); |
function nvm_use_if_needed () { | |
[[ -r ./.nvmrc && -s ./.nvmrc ]] || return | |
WANTED=$(sed 's/v//' < ./.nvmrc) | |
CURRENT=$(hash node 2>/dev/null && node -v | sed 's/v//') | |
if [ "$WANTED" != "$CURRENT" ]; then | |
nvm use | |
fi | |
} | |
export PROMPT_COMMAND="$PROMPT_COMMAND ; nvm_use_if_needed" |
var http = require('http'); | |
function respond (req, res) { | |
console.log('request: ' + req.url); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
} | |
http.createServer(respond).listen(1025, '0.0.0.0'); | |
console.log('Server running at http://0.0.0.0:1025'); |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' | |
green='\033[0;32m' |