Skip to content

Instantly share code, notes, and snippets.

View mattatcha's full-sized avatar

Matt Aitchison mattatcha

View GitHub Profile
package util
import (
"crypto/rand"
"fmt"
)
type UUID [16]byte
// create a new uuid v4

Ultimate OpenStack IceHouse Guide

This is a Quick Guide to deploy OpenStack IceHouse on top of Ubuntu 14.04, it is IPv6-Ready!

It is compliant with OpenStack's official documentation (docs.openstack.org).

The tenant's subnets are based on Neutron, with ML2 plugin and Single Flat Network topology, dual-stacked.

The Single Flat Network is the simplest network topology supported by OpenStack (I think). So, it is easier to understand and follow.

th span {
width: 2em;
display: inline-block;
}
window <<<<
isGradient: -> (it |> /^\s*([a-z]+)\-gradient\(\s*(.*)\s*\)\s*$/gmi.exec)?[1] in <[ linear radial ]>
toFixedOrInt: (precision, value)-->
a={}
power = 10 `Math.pow` (precision or 0)
value = Math.round(value * power) / power
rounded = value |> Math.round
if rounded is value then value = rounded
/** @jsx React.DOM */
/**
* Our component structure will look like the following:
* - WikiBox
* -- AutoCompleteBox
* --- AutoComplete
*/
// this component renders a single entity coming from wikipedia
var gulp = require('gulp');
var rimraf = require('rimraf');
var less = require('gulp-less');
var concat = require('gulp-concat');
var prefixer = require('gulp-autoprefixer');
var cssmin = require('gulp-minify-css');
var jsmin = require('gulp-uglify');
var watch = require('gulp-watch');
var util = require('gulp-util');
var rename = require('gulp-rename');
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
// http://stackoverflow.com/a/20735198/688275
void shuffle(int *arr, size_t n)
{
if (n > 1)
{
@mattatcha
mattatcha / tmux.md
Last active August 29, 2015 14:08 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@mattatcha
mattatcha / _readme.md
Last active August 29, 2015 14:11 — forked from brigand/_readme.md

These macros are designed to provide a literal notation for [immutable-js][1] using [sweetjs][2].

The most interesting being the Map literal

var map = im{"foo": "bar", "baz": "quux"};

This compiles to the 2d array version of Immutable.Map.