Skip to content

Instantly share code, notes, and snippets.

View charlesetc's full-sized avatar
🪁
Flying kites in NYC

Charles Chamberlain charlesetc

🪁
Flying kites in NYC
View GitHub Profile
use "options"
use "path:sys/ioctl"
use @ioctl[None](file: I32, magic: U32, winsize: MaybePointer[Winsize])
struct Winsize
var height: U16 = 0
var width: U16 = 0
new create() => None
diff --git a/src/preproc/eqn/lex.cpp b/src/preproc/eqn/lex.cpp
index b6f15bd..2f2a759 100644
--- a/src/preproc/eqn/lex.cpp
+++ b/src/preproc/eqn/lex.cpp
@@ -239,6 +239,25 @@ static struct builtin_def common_defs[] = {
{ "cdot", "type \"binary\" \\(md" },
{ "cdots", "type \"inner\" { \\(md \\(md \\(md }" },
{ "dollar", "$" },
+ { "emdash", "\\[em]"},
+ { "endash", "\\[en]"},
@charlesetc
charlesetc / strace -f utop
Created November 13, 2016 07:38
strace -f utop
execve("/home/charles/.opam/4.02.3/bin/utop", ["utop"], [/* 62 vars */]) = 0
brk(NULL) = 0xbc3000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=147833, ...}) = 0
mmap(NULL, 147833, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9ca06b5000
close(3) = 0
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pU\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1067376, ...}) = 0
@charlesetc
charlesetc / emojis.txt
Created August 13, 2016 21:27
'Tis surprisingly hard to get a proper list of emojis
😄
😃
😀
😊
😉
😍
😘
😚
😗
@charlesetc
charlesetc / emojis.txt
Created August 13, 2016 21:27
'Tis surprisingly hard to get a proper list of emojis
😄
😃
😀
😊
😉
😍
😘
😚
😗
67
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function hello
(arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2, arg1, arg2,
@charlesetc
charlesetc / breaking_margin.re
Created July 17, 2016 17:40
an edited version of simple_example.ml which shows the formatter break at width 68
/*
A fairly complete demonstration of the features provided
by Easy-format.
*/
open Easy_format;
let list = {
...list,
list_style: Some "list",
#[macro_export]
macro_rules! then {
($op1:expr => $op2:expr) => {
Monad::bind($op1, Box::new(move |_| {
$op2
}))
}
}
// Kind of like `do` notation in haskell.
impl<T> Monad<T, Vec<T>> for Vec<T> {
fn returns(inside: T) -> Self {
vec!(inside)
}
fn bind<'a>(outside: Self, op: Box<Fn(T) -> Self + 'a>) -> S

Keybase proof

I hereby claim:

  • I am charlesetc on github.
  • I am charlesetc (https://keybase.io/charlesetc) on keybase.
  • I have a public key whose fingerprint is 146C F806 71CA 1172 8974 AF99 904F D05B AACD F50E

To claim this, I am signing this object: