Skip to content

Instantly share code, notes, and snippets.

@jjoos
jjoos / Creating some hashes
Last active November 3, 2017 14:56
Generating some hashes of truncated macs
#!/usr/bin/env bash
hexchars="0123456789ABCDEF"
macs=()
for run in {1..10}
do
macs+=($( for i in {1..6} ;do echo -n ${hexchars:$(( $RANDOM % 16 )):1} ; done | sed -e 's/\(..\)/-\1/g' ))
done
seeds=("20171101" "20171102" "20171103")
@jjoos
jjoos / gist:ae4b3e5d0fbd1d25e41f
Last active August 29, 2015 14:08
Avoiding built-in object look ups.
var start = new Date().getTime();
var sum = 0;
for (i = 0; i < 5000000; ++i) {
sum += Math.sin(Math.random());
}
var end = new Date().getTime();
var time = end - start;
@jjoos
jjoos / start
Created February 20, 2014 15:06
[Foreman](https://github.com/ddollar/foreman) isn't supported anymore and there is a really annoying bug. When a process crashes not all other processes get killed properly. Since [foreman](https://github.com/ddollar/foreman) doesn't do too much, @Eamon rewrote it in bash. This is a rewrite inspired by his implementation. This script doesn't bre…
#!/usr/bin/env bash
# default values
env_file_location=".env"
procfile_location="Procfile"
# possibly overwrites $env_file_location
read_command_line_options() {
# read the options
TEMP=`getopt e:h $*`
@jjoos
jjoos / gist:5627713
Last active December 17, 2015 14:49
Start discovering programming in Go for the web.

Install and start your first go app:

brew update
brew install go
mkdir -p $HOME/go
export GOPATH=$HOME/go
go get "github.com/jasondelponte/golib/config"
cd $HOME
gem install gokart
rbenv rehash
# Git log fancify
alias gitlog="git log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative"
alias gitlog1="git log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit"
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
class Example
{
public static void Main (string[] args)
{
Subscribe(1905, "scott@kickofflabs.com");
We couldn’t find that file to show.