Skip to content

Instantly share code, notes, and snippets.

Avatar

Elliot Fosong efosong

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am efosong on github.
  • I am efosong (https://keybase.io/efosong) on keybase.
  • I have a public key whose fingerprint is 7044 DAE1 0314 3E14 A2E2 5D4E B9A7 743D 9826 7C42

To claim this, I am signing this object:

@efosong
efosong / vim_digraphs.txt
Created Jul 21, 2017
Useful vim digraphs
View vim_digraphs.txt
USEFUL VIM DIGRAPHS
Modified from http://www.alecjacobson.com/weblog/?p=443
GENERAL
Rg ®
Co ©
TM ™
/- †
/= ‡
<- ←
View nc_player_first_minimal.cc
// Written by Elliot Fosong
// 'Player first' version of code
// Must be compiled with C++11 (e.g. -std=c++11)
// Program 'length' : 13 semicolons + 8 commas = 21
// *** Goal is to minimise 'length', NOT to produce clean/readable code ***
// Board positions:
// 00 | 10 | 20
// 01 | 11 | 21
// 02 | 12 | 22
View function_lobf.py
# 'Explanation' here : http://einf2.user.srcf.net/function_lobf_explanation.pdf
# Entirely my own work, so definitely not guaranteed to be correct
import math
def integrate(f, low, upp, n=100):
""" INTEGRATES A FUNCTION f BETWEEN low AND upp USING SIMPSON'S RULE """
#split the interval into 2n strips
h = (upp-low)/(2.0*n)
@efosong
efosong / julia_set.py
Created Jan 22, 2016
Generate julia set images.
View julia_set.py
# Requires PIL
import math
class Complex(object):
def __init__(self, real, img):
self.real = real
self.img = img
def __mul__(self, comp):
@efosong
efosong / chase_s7.txt
Last active Jan 22, 2016
Reformats data found on 'the-chase.wikia.com' into a CSV file
View chase_s7.txt
|1
|Anne Hegerty
|2 contestants banked £6,000.
|Target of 14 caught with 0:47 remaining.
|-
|2
|Mark Labbett
|4 contestants banked £60,000.
|Target of 19/Chaser scored 18<br />Each player wins '''£15,000'''.
|-