Skip to content

Instantly share code, notes, and snippets.

@wlaurance
wlaurance / day1.md
Last active December 28, 2015 07:49
Clojure notes

(ns Clojure/conj)

Stu Halloway

###data.fressian

Self describing

CoreText performance note: Client called CTFontCreateWithName() using name "Lato" and got font with PostScript name "Lato-Regular". For best performance, only use PostScript names when calling this API.
@wlaurance
wlaurance / doutti.md
Last active December 30, 2015 20:59
Digital Ocean Ubuntu Things to Install
  • Install Fail2Ban - configure settings
  • Install sendmail (an MTA for Fail2Ban)
  • Change ssh port
  • Disable clear text passwords
  • Create new user
  • Disable Root Ssh logins
var crypto = require('crypto');
var hash = crypto.createHash('sha512');
hash.update("hello");
var sha = hash.digest('hex');
console.log(sha, sha.length);
var crypto = require('crypto');
var hash = crypto.createHash('sha256');
hash.update("hello");
var sha = hash.digest('hex');
console.log(sha, sha.length);
var crypto = require('crypto');
var hash = crypto.createHash('sha1');
hash.update("hello");
var sha = hash.digest('hex');
console.log(sha, sha.length);
@wlaurance
wlaurance / gist:7961562
Last active December 31, 2015 08:39
Not as useful when I inject globals in the browser or something and I want to check for their existence.
$ node
> typeof a
'undefined'
> function _typeof(thing) { return typeof thing; }
undefined
> _typeof(a)
ReferenceError: a is not defined
at repl:1:10
at REPLServer.self.eval (repl.js:110:21)
at Interface.<anonymous> (repl.js:239:12)
@wlaurance
wlaurance / gist:8293885
Created January 7, 2014 02:42
github deprecation warning
remote: /data/github/current/lib/github/githooks/push_context.rb:8: warning: IO#lines is deprecated; use #each_line instead
@wlaurance
wlaurance / split.js
Created January 13, 2014 21:04
Split java classpaths into single lines
process.stdin.on('data', function(d) {
var separate = d.toString().split(':');
console.log(separate.join('\n'));
});
@wlaurance
wlaurance / json-to-yaml.js
Created February 4, 2014 04:50
json header to yaml header
var fs = require('fs');
var YAML = require('json2yaml');
var layout = process.env.JEKYLL_POST_LAYOUT || "post";
process.stdin.on('data', function(d) {
var files = d.toString().split('\n').filter(function(e){ return e !== ''; });
files.map(function(fn) {
var contents = fs.readFileSync(fn).toString();
contents.replace(/({.*title.*})/m, function(match, p1, s) {