Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
// Here is an extremely simple version of work scheduling for multiple | |
// processors. | |
// | |
// The Problem: | |
// We have a lot of numbers that need to be math'ed. Doing this on one | |
// CPU core is slow. We have 4 CPU cores. We would thus like to use those | |
// cores to do math, because it will be a little less slow (ideally | |
// 4 times faster actually). | |
// | |
// The Solution: |
# first install pygmentize to the mac OS X or macOS system with the built-in python | |
sudo easy_install Pygments | |
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc. | |
alias pcat='pygmentize -f terminal256 -O style=native -g' |
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/securecookie" | |
"net/http" | |
) | |
// cookie handling |
package memoize | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// fptr is a pointer to a function variable which will receive a | |
// memoized wrapper around function impl. Impl must have 1 or more | |
// arguments, all of which must be usable as map keys; and it must |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
Prerequisites:
Software components used:
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
# create our directories |
package main | |
import ( | |
"fmt" | |
) | |
func GetStructField(f interface{},path []string) interface{} { | |
rangeOver := f.( map[string]interface{}) | |
counter := 0 | |
maxLen := len(path)-1 |
# -*- coding: utf-8 -*- | |
# 2012-11-12 | |
require 'rubygems' if RUBY_VERSION < "1.9" | |
require 'shellwords' | |
DEFAULT_CURRENCY = '$' | |
ASSETS = '^asset' | |
LIABILITIES = '^liab' | |
CREDIT_CARD = 'liabilities:credit card' | |
INCOME = '^income' |
package main | |
import ( | |
"encoding/csv" | |
"net/http" | |
"html/template" | |
"fmt" | |
"strconv" | |
) |