Skip to content

Instantly share code, notes, and snippets.

@EvanHahn
EvanHahn / gist:2030416
Created March 13, 2012 18:16
Wolfram|Alpha, restyled
/*
Wolfram|Alpha, restyled
by Evan Hahn,
for URL patterns like: *wolframalpha.com/input*
Made for use with Stylebot for Google Chrome
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
@EvanHahn
EvanHahn / gist:1880482
Created February 22, 2012 01:35
My vimrc
syntax on " syntax highlighting
set sw=4 " shift width
set ul=100 " undo level
set ai " auto indent
set si " smart indent
set ruler " show cursor position
@EvanHahn
EvanHahn / euler_method_calculator.cpp
Created August 21, 2011 08:33
Euler Method calculator
/* ***************************
EULER METHOD CALCULATOR
by Evan Hahn (evanhahn.com)
***************************
This will use the Euler method to estimate values of a differential
equation.
Code licensed under a CC-BY 3.0 license:
http://creativecommons.org/licenses/by/3.0/ */
@EvanHahn
EvanHahn / gist:1135851
Created August 10, 2011 01:46
Tic Tac Toe in Lua. Free license.
--[[
TIC-TAC-TOE
by Evan Hahn (http://www.evanhahn.com/)
This is a program that allows you to play tic-tac-toe against the
computer.
You may change the configuration (below) to make the board more than 3x3,
or play with "white" and "black" instead of "x" and "o", and change how
@EvanHahn
EvanHahn / gist:1135646
Created August 10, 2011 00:33
Choose objects by weight. Free license.
/**
* Choose objects by weight.
* @author Evan Hahn
* @version 1.00
* @param {Object[]} objects An array of objects that each have a "weight" property.
* @param {Number} howMany How many should I choose?
* @returns An array of chosen objects, containing howMany values.
* @example
* chooseByWeight([
* {
@EvanHahn
EvanHahn / evankod.css
Created August 2, 2011 19:44
Evan Hahn's Kod theme
/*
* Evan Hahn's Kod theme
* Copyright (c) 2011 Evan Hahn
* Free for any use.
*/
/* General stuff */
body {
font-family: "Monaco", monospace;
@EvanHahn
EvanHahn / detect_rockmelt.js
Created June 7, 2011 23:38
Detect if your browser is RockMelt
function isRockMelt() {
return (navigator.userAgent.indexOf("RockMelt") !== -1)
}