Skip to content

Instantly share code, notes, and snippets.

View mysteriouspants's full-sized avatar
:shipit:
Help! I'm trapped in a fixed-width str

Christopher R. Miller mysteriouspants

:shipit:
Help! I'm trapped in a fixed-width str
View GitHub Profile
@mysteriouspants
mysteriouspants / surprise.sh
Created November 22, 2014 09:03
I'm actually surprised this worked (the ffmpeg big was new to me; youtube-dl has worked very reliably for me).
youtube-dl -f 298,299 https://www.youtube.com/watch?v=AdfFnTt2UT0
ffmpeg -i “This\ is\ EVE”\ -\ Uncensored\ \(2014\)-AdfFnTt2UT0.mp4 -i “This\ is\ EVE”\ -\ Uncensored\ \(2014\)-AdfFnTt2UT0.m4a -vcodec copy -acodec copy -map 0:0 -map 1:0 -y this_is_eve.mp4
# Chris Miller ([email protected]), CS124
# Copyright (C) 2014 Chris Miller. Aw richts pitten by.
# Academic endorsement. This code is not licensed for commercial use.
# 20140404, Chapter 17 Programming Challenge 1
CXX=clang++
CXXFLAGS=-std=c++11 -stdlib=libc++ -Wall
SOURCES=ch17pc1.cpp linked_list.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=ch17pc1

Install MoinMoin they said! It'll be easy they said!

Laundry Room Viking

apt-get install -y nginx uwsgi{,-plugin-python,-emperor}
wget http://static.moinmo.in/files/moin-1.9.7.tar.gz
tar xzvf moin-1.9.7.tar.gz
cd moin-1.9.7.tar.gz
python setup.py install --force --prefix=/usr/local --record=install.log

mkdir -p /var/www/staff-wiki

In 1986, Peter Davies was on holiday in Kenya after graduating from Louisiana State University . On a hike through the bush, he came across a young bull elephant standing with one leg raised in the air. The elephant seemed distressed, so Peter approached it very carefully. He got down on one knee, inspected the elephants foot, and found a large piece of wood deeply embedded in it. As carefully and as gently as he could, Peter worked the wood out with his knife, after which the elephant gingerly put down its foot. The elephant turned to face the man and with a rather curious look on its face, stared at him for several tense moments. Peter stood frozen, thinking of nothing else but being trampled. Eventually the elephant trumpeted loudly, turned and walked away. Peter never forgot that elephant or the events of that day. Twenty years later, Peter was walking through the Chicago Zoo with his teenaged son. As they approached the elephant enclosure, one of the creatures turned and walked over to near where Peter a

@mysteriouspants
mysteriouspants / quotes.md
Last active December 28, 2015 17:59
Great quotes of programming, computer science, and mathematics. If you have on to add, please fork and contribute!

It has been said that Amazon AWS is the worst form of PaaS except all the others that have been tried.

Winston Churchill

There are only two hard things in Computer Science: cache invalidation and naming things.

Phil Karlton

Give a man a game engine and he delivers a game. Teach a man to make a game engine and he never delivers anything.

@mysteriouspants
mysteriouspants / moms spaghetti.txt
Last active December 25, 2015 11:29
Left me in stitches.
Look, if you had one pot, or one opportunity
To eat all the spaghetti you ever wanted in one moment
Would you capture it or just let it slip through your fork?
Yo
His palms are penne, knees meat, arms spaghetti
Add meatballs to the spaghetti, mom's secret recipe
He's nervous, but on the surface mom's spaghetti looks ready for meatballs
but he eats all the spaghetti, he can choke down,
the whole crowd goes spaghetti
Eyjafjallajokull::Application.configure do
# ... other boring configuration which doesn't relate to ActionMailer
config.action_mailer.default_url_options = { host: 'localhost:3000' }
config.action_mailer.delivery_method = :file
config.action_mailer.file_settings = { location: Rails.root.join('tmp/mail') }
end
@mysteriouspants
mysteriouspants / duff-loop.cpp
Created January 14, 2013 06:36
Just some rubbish to prove the duff's loops work for n>0, when you get the do{}while condition right. I didn't in a blog post, so I investigated. And that's what I found. About to delete the file from my hard drive, but I wanted to paste the code somewhere for safe keeping.
#include <iostream>
#include <cstdlib>
int main(int args, const char* argv[]) {
register size_t n,
i=0,
j=0;
if (args == 2) {
n = atoi(argv[1]);
@mysteriouspants
mysteriouspants / 000-README.md
Created November 7, 2012 17:08
HAML vs ERB vs SLIM on JRuby 1.7.0 Showdown!

Section of Introductions

This was all done on a rather nice iMac:

  • Intel Core i7 Sandy-Bridge 4-core chip
  • 12 GB of RAM
  • 1TB Spinning-disk hard drive
  • java version 1.6.0_37, build 1.6.0_37-b06-434-11M3909 "HotSpot" 64-bit VM "mixed mode" (whatever that's supposed to mean)
  • The excellent pre-chewed testing app at
@mysteriouspants
mysteriouspants / rspec binstub.txt
Created October 22, 2012 15:49
TorqueSpec Failure
cmiller@cmiller-iMac:~/Code/ww-support/cuttlefish/src/var/www/cuttlefish
> which rspec jruby [337ddae]
/Users/cmiller/.rbenv/shims/rspec
cmiller@cmiller-iMac:~/Code/ww-support/cuttlefish/src/var/www/cuttlefish
> cat `which rspec` jruby [337ddae]
#!/usr/bin/env bash
set -e
export RBENV_ROOT="/Users/cmiller/.rbenv"
exec rbenv exec "${0##*/}" "$@"