Skip to content

Instantly share code, notes, and snippets.

View jl2's full-sized avatar

Jeremiah LaRocco jl2

View GitHub Profile
#!/usr/bin/python
# Really simple example of usint cgkit's RenderMan
# Interface binding to generate a RIB file.
from cgkit.ri import *
from math import *
import sys
#!/usr/bin/python
# Really simple example of usint cgkit's RenderMan
# Interface binding to generate a RIB file.
from __future__ import print_function
from cgkit.ri import *
from math import *
import sys
// Interesting C++ exception handling technique?
#include <iostream>
#include <cstdlib>
#include <ctime>
void damn() {
std::cout << "Damn\n";
}
@jl2
jl2 / wiki_table_merge.py
Created October 19, 2010 22:51
Merge two or more wiki tables and merge duplicate entries based on 'key' columns in each table
#!/usr/bin/python3
# Script to merge two or more wiki tables and merge duplicate entries based on 'key' columns in each table
# How to use:
# wikimerge.py keys columns files...
# 'keys' is a comma seperated list of key columns for each table
# This is the column from each table that will be joined on
# Do not put spaces in the list. Use '1,2,3', not '1, 2, 3'
@jl2
jl2 / hello.cpp
Created December 22, 2010 18:11
Funny C++ hello world program
#include <iostream>
class WTF {
public:
WTF() : val(this) { }
WTF* operator->() {
std::cout << "hello ";
return this;
}
WTF &operator*() {
@jl2
jl2 / scmgl.scm
Created January 7, 2011 01:32
OpenGL using Gauche Scheme
(use gl)
(use gl.glut)
(use math.const)
(define cur-angle 0.0)
(define num-segments 16)
(define (init)
(let ((mat-ambient '#f32(1.0 1.0 1.0 1.0))
@jl2
jl2 / gpxparse.scm
Created January 10, 2011 15:53
Parse a GPX file with Gauche scheme
#!/usr/bin/env gosh
(use srfi-1) ;; List library
(use srfi-13) ;; String library
(use srfi-19) ;; Date/time
(use sxml.ssax)
(define (make-tpt)
(list 0 0 0 0))
#!/usr/bin/env gosh
;; Update Windows Chromium to the latest build
(use rfc.http)
(define (web-get host url)
(receive (respCode headers body) (http-get host url) body))
(define (main args)
##!/usr/bin/ruby
# Quick and dirty C++ inheritance tree using GraphViz's dot command
# Limitations:
# * Only handles single inheritance
# * Base classes must be specified on a single line:
# Such as "class Foo : public Bar"
require "find"
ofile = ARGV.shift
@jl2
jl2 / update_chrome.py
Created March 25, 2011 20:18
Automatically install the latest build of Chromium
#!/usr/bin/env python3
import os
import subprocess
import http.client
# Install the latest Chromium snapshot build on Windows
conn = http.client.HTTPConnection('build.chromium.org')
conn.request("GET", '/f/chromium/snapshots/chromium-rel-xp/LATEST')
r1 = conn.getresponse()