Skip to content

Instantly share code, notes, and snippets.

View lambda-fairy's full-sized avatar
💜
Hello!

Chris Wong lambda-fairy

💜
Hello!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lambda-fairy on github.
  • I am lfairy (https://keybase.io/lfairy) on keybase.
  • I have a public key whose fingerprint is 0658 29A6 73B2 9A01 6E68 EC42 4AFA FC07 E9D2 794C

To claim this, I am signing this object:

@lambda-fairy
lambda-fairy / textanalyzer.py
Created December 28, 2018 07:23
Report the most common phrases in a text file
#!/usr/bin/env python3
from collections import Counter
from itertools import islice
import re
import string
import sys
MIN_PHRASE_LENGTH = 2
@lambda-fairy
lambda-fairy / twilight-1.md
Last active January 11, 2019 20:34
Twilight Sparkle's Magic Spells

Twilight Sparkle's Magic Spells

Twilight Sparkle is researching some magic spells. A spell is a non-empty finite sequence of Apples, Bananas, or Ciwifruit.

Spells can be safe or unsafe. An unsafe spell contains one or more of the following patterns:

Pattern Name

(Sung to the tune of the Fourmyula song)

Through falling hairs
I pick my way slowly
Farting aloud
Eases my behind

Sunlight filters through

@lambda-fairy
lambda-fairy / summary.json
Created August 11, 2017 09:37
curl https://crates.io/summary | python3 -m json.tool
{
"num_downloads": 196498909,
"num_crates": 10729,
"new_crates": [
{
"id": "gotham_derive",
"name": "gotham_derive",
"updated_at": "2017-08-11T05:40:09Z",
"versions": null,
"keywords": null,
@lambda-fairy
lambda-fairy / safecopy_example.rs
Last active March 11, 2017 07:21
Versioned serialization a la safecopy
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate safecopy;
#[safecopy(CrusadersV0 = "0", CrusadersV1 = "1", Crusaders = "2")]
pub struct Crusaders {
apple_bloom: String,
sweetie_belle: String,
@lambda-fairy
lambda-fairy / quotes.md
Created January 10, 2017 05:10
Nice quotes

You can fondle the cube, but it will not respond. -- Warren Buffett

Feelings are boring. Kissing is awesome! -- Ryan North

@lambda-fairy
lambda-fairy / crates-with-negative-features.txt
Last active January 2, 2017 22:08
List of crates whose latest version has a feature prefixed with "no_"
As of Jan 3, 2017
approx:0.1.1 -- ['no_std']
ascii:0.7.1 -- ['no_std']
bitmap:3.1.3 -- ['no_std']
cbuf:0.1.1 -- ['no_std']
cmdline_words_parser:0.0.2 -- ['no_std']
defrag:0.1.3 -- ['no_std']
discrimination:0.0.0 -- ['no_std']
dpc-cbuf:0.0.1 -- ['no_std']
@lambda-fairy
lambda-fairy / swfextract_kun.py
Created January 2, 2017 05:51
Script for extracting an SWF file from a projector executable
#!/usr/bin/env python3
"""Extracts an SWF file from a projector executable"""
import os
import sys
def strip_exe_extension(path):
root, ext = os.path.splitext(path)
if ext.casefold() == '.exe':
@lambda-fairy
lambda-fairy / main.s
Created December 8, 2016 09:41
Maud HTML escaper assembly
.text
.intel_syntax noprefix
.file "rust_out.cgu-0.rs"
.section ".text._ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$6double17h17920b8a90cfe6cfE","ax",@progbits
.p2align 4, 0x90
.type _ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$6double17h17920b8a90cfe6cfE,@function
_ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$6double17h17920b8a90cfe6cfE:
.cfi_startproc
push r14
.Ltmp0: