Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
/*eslint-env es6 */ | |
// Inspired by the paper "A tutorial on the universality and | |
// expressiveness of fold" by Graham Hutton (available at | |
// http://www.cs.nott.ac.uk/~gmh/fold.pdf), implementing some generic | |
// list handling functions in JavaScript in terms of `fold`. | |
// Personally I had an enlightnening moment when I realised the | |
// beautiful interplay of cons lists and foldr during the FP101x | |
// Haskell course. JavaScript's syntax doesn't make this very apparent |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
interface Option<T> { | |
map <U>(fn: (a: T) => U): Option<U>; | |
isSome(): boolean; | |
isNone(): boolean; | |
isSomeAnd(fn: (a: T) => boolean): boolean; | |
isNoneAnd(fn: () => boolean): boolean; | |
unwrap(): T; | |
unwrapOr(def: T): T; | |
unwrapOrElse(f: () => T): T; | |
map<U>(f: (a: T) => U): Option<U>; |
DELIMITER | | |
CREATE FUNCTION uuid_from_bin(b BINARY(16)) | |
RETURNS CHAR(36) DETERMINISTIC | |
BEGIN | |
DECLARE hex CHAR(32); | |
SET hex = HEX(b); | |
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12)); | |
END | |
| |
This tutorial uses the "Sample hapi.js REST API" project.
Take a look at: https://github.com/agendor/sample-hapi-rest-api/
##Topics
# Prevent Fish shell from generating strings when in non-interactive mode (e.g. while using SCP) | |
# Add this to the top of your config.fish file | |
if not status --is-login or not status --is-interactive | |
exit | |
end |
const t = require("tcomb"); | |
// imstruct is a tcomb type builder that internally builds an | |
// Immutable.Record object, but applies tcomb's type system to it | |
const imstruct = require("../util/imstruct"); | |
const Person = imstruct({ | |
name: t.String, | |
age: t.Number | |
}); |