Skip to content

Instantly share code, notes, and snippets.

View StaymanHou's full-sized avatar

Stayman Hou StaymanHou

View GitHub Profile
# Simple bijective function
# Basically encodes any integer into a base(n) string,
# where n is ALPHABET.length.
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047
ALPHABET =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//)
# make your own alphabet using:
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click_on('Link Text') # Click either a link or a button
click_on('Button Value')
@StaymanHou
StaymanHou / install-ffmpeg-centos-amzn.sh
Last active January 20, 2016 00:45
shell script for a full compilation & installation of ffmpeg on CentOS and Amazon Linux
#!/bin/bash
# date: Jan 7, 2015
# author: Stayman Hou
# please run as root user
# after install, ffmpeg command will be executable for all users, including root and non-root
yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
@StaymanHou
StaymanHou / cars.info
Created February 8, 2016 23:31
cars.info file for OpenCV UIUC car detection training
/tmp/car_detection/CarData/TrainImages/pos-0.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-1.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-2.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-3.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-4.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-5.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-6.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-7.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-8.pgm 1 0 0 100 40
/tmp/car_detection/CarData/TrainImages/pos-9.pgm 1 0 0 100 40
@StaymanHou
StaymanHou / bg.txt
Created February 8, 2016 23:41
bg.txt file for OpenCV UIUC car detection training
/tmp/car_detection/CarData/TrainImages/neg-0.pgm
/tmp/car_detection/CarData/TrainImages/neg-1.pgm
/tmp/car_detection/CarData/TrainImages/neg-2.pgm
/tmp/car_detection/CarData/TrainImages/neg-3.pgm
/tmp/car_detection/CarData/TrainImages/neg-4.pgm
/tmp/car_detection/CarData/TrainImages/neg-5.pgm
/tmp/car_detection/CarData/TrainImages/neg-6.pgm
/tmp/car_detection/CarData/TrainImages/neg-7.pgm
/tmp/car_detection/CarData/TrainImages/neg-8.pgm
/tmp/car_detection/CarData/TrainImages/neg-9.pgm