Instantly share code, notes, and snippets.


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

View summary.json
"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,
extern crate serde;
extern crate serde_derive;
extern crate safecopy;
#[safecopy(CrusadersV0 = "0", CrusadersV1 = "1", Crusaders = "2")]
pub struct Crusaders {
apple_bloom: String,
sweetie_belle: String,

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

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

View crates-with-negative-features.txt
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']
#!/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':
enum False {}
enum True {}
trait Equal<B> { type Output; }
impl<A, B> Equal<B> for A { default type Output = False; }
impl<A> Equal<A> for A { type Output = True; }
View main.s
.intel_syntax noprefix
.file ""
.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
push r14

Design goals

  • Perfect C compatibility

    • Every C type is a Chara type and vice versa
    • Use a similar compilation model
  • Stay simple: don't add super advanced features like C++ or Rust

  • Clean up C cruft

    • Undefined integer overflow