towards enlightenment
‘It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.’
function slugify( title ) { | |
return (title+'') | |
.toLowerCase() | |
.replace(/\s+/g, '-') | |
.replace(/[!"'£$%\^&*()_+=\/\|`¬/><.,{}[\]:;]/g, '') | |
.replace(/\-\-+/g, '-') | |
.replace(/^-+/, '') | |
.replace(/-+$/, '') | |
} |
/** | |
* Parser base class | |
* ractivejs/ractive/blob/master/src/parse/ | |
*/ | |
var Parser, ParseError, leadingWhitespace = /^\s+/; | |
ParseError = function ( message ) { | |
this.name = 'ParseError'; | |
this.message = message; |
(function() { | |
"use strict"; | |
var root = typeof self == 'object' && self.self === self && self || | |
typeof global == 'object' && global.global === global && global || | |
this; | |
var micro = function (obj) { | |
if (obj instanceof micro) return obj; | |
if (!(this instanceof micro)) return new micro; |
a { | |
display: inline-block | |
vertical-align: middle | |
} :hover { | |
opacity: .7 | |
} | |
header !important { | |
background-color: pink | |
(function(exports, document, Element, Array) { | |
"use strict"; | |
let selectorPattern = /^(#?[\w-]+|\.[\w-.]+)$/; | |
let periods = /\./g; | |
// https://github.com/ryanmorr/query | |
function query(selector, context, first) { | |
context = context || document; | |
let results = null; |
#!/usr/bin/env node | |
// ircd demo for jsconf.eu/2009 | |
// This was written with Node version 0.1.16. An earlier version will not | |
// work with this script, however later versions might. | |
port = 6667; | |
serverName = "irc.nodejs.org"; | |
topic = "node.js ircd https://gist.github.com/a3d0bbbff196af633995"; | |
export default const compose = (fns) => { | |
return (...args) => { | |
return fns.reduce( | |
(f, g) => { | |
return g( | |
typeof f === 'function' ? | |
f(...args) : | |
f | |
) | |
} |
Afghanistan | |
Åland Islands | |
Albania | |
Algeria | |
American Samoa | |
Andorra | |
Angola | |
Anguilla | |
Antarctica | |
Antigua and Barbuda |
module.exports = [ | |
function setContentType(req, res) { | |
res.header('content-type', 'text/html') | |
}, | |
/* | |
function catchAll(req, res) { | |
res.pipe('error %s', res.status) | |
} | |
*/ | |
] |