Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
pesterhazy / git-ag
Created Mar 1, 2014
Search your git repository using ag (the silver searcher)
View git-ag
# Put additional ignore patterns (one by line) in .grepignore
git-ag () {
if [[ "$1" = "-a" ]]
View gist:5f97d8db71776b188820
typedef struct chan_t
pthread_mutex_t m_mu;
pthread_cond_t m_cond;
int closed;
void (* dispose)(struct chan_t * self);
} chan_t;
View gist:b282171c988e05b9ddab
func (self *Security) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
// Browser CORS
origin := r.Header.Get(mjdlib.HttpHeaderKeyOrigin);
// Browser CORS Origin: a Preflight Request (OPTIONS)
if r.Method == "OPTIONS" {
mjdlib.LogInfo("**CORS OPTIONS URL %v: \n request = %v\n", r.RequestURI, r)
JosephRedfern / Speedtest
Last active Sep 16, 2015
Scaleway ARM machine
View Speedtest
root@beryllium:~# wget
converted '' (ANSI_X3.4-1968) -> '' (UTF-8)
--2015-09-03 11:28:49--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: '100mb.test'
100mb.test 100%[==========================================================================================================================================>] 100.00M 50.1MB/s in 2.0s
anonymous / db.go
Created Jan 24, 2012
Go SDK for Dropbox
View db.go
package dropbox
import (

This is total shit quickly banged out in probably hard to follow semi-formalism.

TL/DR part, skip to next section

Complex numbers (C) can be viewed as a scalar bivector pair. A 2D bivector requires 1 element (note 1), so we have C ~= R1+R1 ~= R2 with basis {1,i}.

Denote a complex number: z = a+bi = (a, b), {a,b} on R. Associating C with R2 we can interpret (a,b) as a coordinate (in the plane). Functions over C map coordinates in the plane to other coordinates in the plane. We can define principle value (single valued) functions for: log, exp and powers (among others).

For power we can rewrite 'z' into a polar form z = m(cos(a), sin(a)), m >= 0, a on [pi,-pi). Then the princle power can be denoted as:

zt = mt(cos(ta), sin(ta))

nf / analyze.go
Last active Jan 12, 2016
'spent' script to log where time is spent
View analyze.go
package main
import (
cecilemuller /
Last active Jan 29, 2016
Let's encrypt (Nginx, Ubuntu 14.04 LTS)

Install the client:

apt-get install git
git clone
cd letsencrypt

Generate certificates using manual mode:

mdigital /
Created Apr 18, 2012
Debian / Ubuntu Tarsnap installation
# Installs tarsnap client on Debian and Ubuntu
# You'll need to setup an account at
# and load it with some funds
# Make sure you run this as root
houmei / bcdall0.v
Created Jan 27, 2013
FizzBuzz by FPGA DE0 (QuartusII,verilog)
View bcdall0.v
module bcdall0(BCD3,BCD2,BCD1,BCD0, lampoff);
input [3:0] BCD3;
input [3:0] BCD2;
input [3:0] BCD1;
input [3:0] BCD0;
output lampoff;
assign lampoff=(BCD0==4'd0)&(BCD1==4'd0)&(BCD2==4'd0)&(BCD3==4'd0);