Skip to content

Instantly share code, notes, and snippets.

View shanecelis's full-sized avatar

Shane Celis shanecelis

View GitHub Profile
#!/bin/bash
# timelapse
#
# Records a sequence of screencaptures at regular intervals on Mac OS
# X. Can also record using webcam if you have isightcapture
# installed.
#
# http://www.intergalactic.de/pages/iSight.html
#
# Shane Celis
#!/bin/bash
# compete
if [ $# -eq 0 ]; then
echo "usage: compete <n> <classnames(s)>" >&2;
echo " n number of rounds" >&2;
echo "creates a CSV output for the competition.">&2;
exit 2;
fi
#!/bin/bash
# mycompete
if [ $# -eq 0 ]; then
echo "usage: compete <n> <player1-classname> <player2-classnames(s)>" >&2;
echo " n number of rounds for p1 vs. p2 and p2 vs. p1 (so 2n rounds total)" >&2;
echo "creates a CSV output for the competition.">&2;
exit 2;
fi
#!/usr/bin/env ruby
# parse-kevin
if ARGV.length != 2 then
puts "usage: parse-kevin <listen-for> <input>"
exit(1)
end
pattern = ARGV[0]
infile = File.new(ARGV[1], "r")
readingRightListen = false
@shanecelis
shanecelis / pastels-on-dark-theme.el
Last active October 1, 2015 02:57
Pastels on Dark theme for Emacs 24
;;; pastels-on-dark-theme.el --- Pastels on Dark theme for Emacs 24
;; Author: Mats Persson
;; Maintainer: Shane Celis <shane (at) gnufoo (dot) org>
;; URL: http://gist.github.com/1906662
;; Version: 0.3
;; Keywords: theme, color
;;; Commentary:
@shanecelis
shanecelis / line-pragma.scm
Last active October 3, 2015 08:17
Recognize #line <line-number> <filename> statements in your Guile code.
;; line-pragma.scm
;;
;; This code extends the reader to recognize #l and is meant to
;; be used the same way as the #line pragma in C. This way you can
;; sprinkle your code with lines like this:
;;
;; (define (f x)
;; #line 314 "increment-literately.w"
;; (+ x 1))
;;
@shanecelis
shanecelis / gist:2779930
Created May 24, 2012 07:01 — forked from branan/gist:1562391
Example OpenGL3.2 buffer/shader usage
/*
Original: 1562391 by branan
Updated to use GLFW so it works on Mac OS X Lion
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define GLFW_NO_GLU
#define GLFW_INCLUDE_GL3
@shanecelis
shanecelis / convenience-lambda.scm
Created May 26, 2012 16:24
A succinct anonymous procedure syntax for Guile scheme
;; convenience-lambda.scm
;;
;; This syntax was inspired by arc and Clojure's anonymous procedure
;; syntax.
;;
;; #.\ (+ %1 %2) -> (lambda (%1 %2) (+ %1 %2))
;; #.\ (+ % %%) -> (lambda (% %%) (+ % %%))
;;
;; The .\ is supposed to approximate the lowercase lambda character in
;; ascii.
@shanecelis
shanecelis / visualization-library-with-sdl-example.cpp
Created June 9, 2012 18:36
Example of using the Visualization Library without a GUI wrapper
/* visualization-library-with-sdl-example.cpp
This is an example of using the Visualization Library (VL) [1]
without using any of its GUI wrappers. It will render a spinning
cube just like the basic scene setup example[2]. However, it does
not respond to mouse events.
As a suggestion for the future work on VL, I would recommend
separating the OpenGLContext class which is required for rendering
from what is required for providing a GUI abstraction that will
#!/bin/sh
#
# shrinkpdf
#
# Shane Celis
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
echo "usage: shrinkpdf <in.pdf> [out.pdf]" >&2;
echo "Shrink the size of the given PDF. By default it outputs to file 'out.pdf'." >&2;
exit 2;