Skip to content

Instantly share code, notes, and snippets.

View lukechampine's full-sized avatar

Luke Champine lukechampine

View GitHub Profile
@lukechampine
lukechampine / explore.go
Created April 4, 2017 20:09
Helper for exploring patterns in the Sia blockchain
package main
import (
"encoding/json"
"io/ioutil"
"log"
"os"
"github.com/NebulousLabs/Sia/encoding"
"github.com/NebulousLabs/Sia/persist"

Keybase proof

I hereby claim:

  • I am lukechampine on github.
  • I am lukechampine (https://keybase.io/lukechampine) on keybase.
  • I have a public key whose fingerprint is 99C2 18A7 FA3C C119 562B D6C5 A5C1 CE07 4CBF 1D60

To claim this, I am signing this object:

@lukechampine
lukechampine / Y Combinator in Haskell.md
Last active November 15, 2023 07:30
Deriving the Y Combinator in Haskell

The Y Combinator

The Y Combinator is a classic lambda calculus construct that many people find baffling. Here's my attempt to explain it as clearly as possible (no promises!). Familiarity with Haskell syntax is assumed.

The problem we're trying to solve is how to write an anonymous function (a "lambda") that is recursive. Normally, if you want to write a recursive function, it looks like this:

fac n = if n == 0 then 1
        else n * fac (n-1)
@lukechampine
lukechampine / a.c
Created October 19, 2014 01:00
a.c (with a.h expanded)
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/mman.h>
typedef void V;typedef int I;typedef double F;typedef unsigned char C,*S;typedef long L;
#define O printf
#define R return
#define I(a...) if(a)
#define W(a...) while(a)

how to into git (and GitHub)

This is a handy reference for setting up and using git to contribute to projects on GitHub. It is by no means a complete guide to using git; use http://gitref.org for that.

Update: This site provides some excellent visualizations of what various git commands do. Highly recommended.

basics

setup

First run the following commands, using your real name and GitHub email address: