Skip to content

Instantly share code, notes, and snippets.

View emilyst's full-sized avatar

Emily Strickland emilyst

View GitHub Profile
@emilyst
emilyst / video2gif-filtergraph-diagram.txt
Last active April 26, 2019 01:40
Diagram of video2gif filtergraph
.─────────.
( input )
`─────────'
┌────────────┐
│ fps │
└────────────┘
@emilyst
emilyst / sleepwake-iokit.py
Created March 19, 2019 03:44
This doesn't work either
#!/usr/bin/env python3
import objc
from Foundation import (
NSDate,
NSDefaultRunLoopMode,
NSLog,
NSObject,
NSRunLoop,
NSThread,
@emilyst
emilyst / sleepwake-threaded.py
Created March 19, 2019 03:39
This doesn't work
#!/usr/bin/env python3
import threading
# from multiprocessing import Pool
# from multiprocessing import Process
class EventLoopThread(threading.Thread):
def __init__(self):
super(EventLoopThread, self).__init__()
@emilyst
emilyst / # macvim - 2018-09-08_10-35-42.txt
Created September 8, 2018 17:43
macvim on macOS 10.14 - Homebrew build logs
Homebrew build logs for macvim on macOS 10.14
Build date: 2018-09-08 10:35:42
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int is_valid(const char* password) {
if (strcmp(password, "poop") == 0) {
return 1;
} else {
return 0;
}
@emilyst
emilyst / .vimrc
Last active July 24, 2016 17:45
I'm trying to keep this up to date with whatever my actual .vimrc is at the time. It may or may not track pretty closely, but at the time of writing this description (1 Mar 14), it's perfectly up to date.
" 0 preamble ============================================================== {{{
"
" There is a great organization scheme in place here. If you run the
" :options command in Vim, you see a list of all the options that you
" can set, along with their current settings and a brief description of
" them. The great thing about this scheme is that--for better or
" worse--it sets up a system which can organize all my settings. I've
" decided to organize everything below thus, throwing ancillary things
" (my own mappings, plugin settings, and so on) where it makes sense.
"
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
#!/usr/bin/perl
use Text::CSV;
my $csv = Text::CSV->new();
while (<>) {
$csv->parse($_);
my @row = $csv->fields();
print $row[7];
function! s:SwitchToFromTest() " {{{
let currentfilename = expand("%:t")
let pathtocurrentfile = expand("%:p:h")
let endofpath = fnamemodify(pathtocurrentfile, ":t")
if endofpath == "TEST"
let filename = fnamemodify(pathtocurrentfile, ":h") . "/" . currentfilename
else
let filename = pathtocurrentfile . "/TEST/" . currentfilename
endif
@emilyst
emilyst / fib.rs
Last active January 2, 2016 07:35
Simple Fibonacci algorithm in Rust.
fn main() {
let number = 20;
println(fmt!("%?th fib number is: %?", number, fib(number)));
}
fn fib(x: int) -> int {
match x {
0 | 1 => x,
_ => fib(x - 1) + fib(x - 2),
}