Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Celis shanecelis

View GitHub Profile
View timelapse
#!/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
View compete
#!/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
View mycompete
#!/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
View gist:402125
#!/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 Oct 1, 2015
Pastels on Dark theme for Emacs 24
View pastels-on-dark-theme.el
;;; 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 Oct 3, 2015
Recognize #line <line-number> <filename> statements in your Guile code.
View line-pragma.scm
;; 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 — forked from branan/gist:1562391
Example OpenGL3.2 buffer/shader usage
View gist:2779930
/*
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
A succinct anonymous procedure syntax for Guile scheme
View convenience-lambda.scm
;; 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 Jun 9, 2012
Example of using the Visualization Library without a GUI wrapper
View visualization-library-with-sdl-example.cpp
/* 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
View shrinkpdf
#!/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;