Skip to content

Instantly share code, notes, and snippets.

View xandkar's full-sized avatar
🤔
quis custodiet ipsos custodes?

Siraaj Khandkar xandkar

🤔
quis custodiet ipsos custodes?
View GitHub Profile
@ericbmerritt
ericbmerritt / gist:3879889
Created October 12, 2012 15:47
Generally useful makefile
# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
@ericbmerritt
ericbmerritt / dialyzer.mkf
Created September 2, 2012 14:59
Dialyzer Example Makefile
# -*- mode: Makefile; fill-column: 80; comment-column: 75; -*-
ERL = $(shell which erl)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
@tarcieri
tarcieri / clojure.clj
Created May 7, 2012 18:53
Associative data structures: Erlang vs Clojure
Clojure 1.3.0
user=> {:foo :bar, :baz :qux}
{:foo :bar, :baz :qux}
@jlouis
jlouis / annealing.erl
Created April 28, 2012 20:13
Improved parallel scheme, introduce more advanced temp function.
-module(annealing).
-export([anneal/1, anneal/2]).
-define(KMAX, 1000).
-define(EMAX, 0.00001).
-define(GRACE, 500).
anneal(S0) ->
anneal(S0, 4).
@jlouis
jlouis / annealing.erl
Created April 27, 2012 20:29
Anneal y = (X + 4)(X + 1)(X -2) / 4 -- in parallel.
-module(annealing).
-export([anneal/1, anneal/2]).
-define(KMAX, 2500).
-define(EMAX, 0.00001).
-define(INITIAL_TEMP, 100000).
anneal(S0) ->
anneal(S0, 4).
@jlouis
jlouis / annealing.erl
Created April 25, 2012 18:46
Anneal y = (X + 4)(X + 1)(X -2) / 4 :)
-module(annealing).
-export([anneal/1]).
-define(KMAX, 10000).
-define(EMAX, 0.00001).
-define(INITIAL_TEMP, 100000).
anneal(S0) ->
random:seed(os:timestamp()),
@yosemitebandit
yosemitebandit / key-fingerprint
Created March 7, 2012 18:27
view your ssh public key's fingerprint; compare this to what Github has listed in the ssh key audit
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
@bryanhunter
bryanhunter / build-erlang-r15b.sh
Created January 12, 2012 20:52
Build Erlang R15B on a fresh Ubuntu box (tested on Ubuntu 11.10)
#!/bin/bash
# Pull this file dowm, make it executable and run it with sudo
# wget https://raw.github.com/gist/1603037/build-erlang-r15b.sh
# chmod u+x build-erlang-r15b.sh
# sudo ./build-erlang-r15b.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
@jonifreeman
jonifreeman / gist:1306258
Created October 22, 2011 17:35
Port of submit.m Octave functionality to Haskell
import System.IO
import Control.Exception
import Numeric.LinearAlgebra
import Data.Digest.Pure.SHA
import Data.ByteString.Lazy.Char8 as BS8 (pack)
import Data.List (sort)
import System.Random (randomRIO)
import Network.Curl
import Text.Printf (printf)
import Data.List.Split (splitOn)
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade