Skip to content

Instantly share code, notes, and snippets.

@NelsonMinar
NelsonMinar / anthem-rebate-2011.txt
Created July 19, 2012 22:26
Anthem Blue Cross of California 2011 rebate
**Notice of health insurance premium rebate**
Re: Health insurance premium rebate for year 2011; subscriber ID xxxxxxxxx
Dear Nelson Minar:
This letter is to inform you that you will receive a rebate of a portion of your health
insurance premiums. This rebate is required by the Affordable Care Act – the health
reform law.
@NelsonMinar
NelsonMinar / index.html
Created July 29, 2012 21:17
Cantor pairing function
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<title>Cantor pairing function</title>
<style>
td { min-width: 2em; text-align: right; }
</style>
</head>
@NelsonMinar
NelsonMinar / windhistory.js
Created September 1, 2012 22:31
windhistory.com D3 code
// This is the core Javascript code for http://windhistory.com/
// I haven't done a full open source release, but I figured I'd put the most important
// D3 code out there for people to learn from. --nelson@monkey.org
/** Common wind rose code **/
// Function to draw a single arc for the wind rose
// Input: Drawing options object containing
// width: degrees of width to draw (ie 5 or 15)
// from: integer, inner radius
@NelsonMinar
NelsonMinar / index.html
Created November 16, 2012 00:16
Demonstration of red/blue interpolation options
<!DOCTYPE html>
<html> <head>
<script src="http://d3js.org/d3.v2.js"></script>
<style type="text/css">
svg text { font: 12px sans-serif; fill: white; text-anchor: middle; opacity: 0.7;}
h2 { font-family: Helvetica; font-size: 16px; padding: 8px 0px 3px 0px; margin: 0 0 0 0; }
</style>
</head>
<body>
print('Hello turtle!')
for i=0,3 do
print(i)
end
@NelsonMinar
NelsonMinar / urlex.lua
Created February 5, 2013 19:21
Run an arbitrary URL as Lua code in ComputerCraft (Minecraft)
-- Execute a URL as Lua code in ComputerCraft
-- Usage: "urlex URL"
-- Parse arguments
local args = {...}
local url = args[1]
-- Load the page
local page = http.get(args[1])
src = page.readAll()
page.close()
@NelsonMinar
NelsonMinar / tube.lua
Created March 12, 2013 01:55
Minecraft turtle program to make tubes
-- Build a tube, a safe passage for someone to move (as through the Nether)
-- Usage: "tube N", where N is the number of squares forward to build the tube
-- Fuel goes in slot 16
-- Torches in slot 15
-- Building materials in 1-14
-- Utility function: refuel, move forward, dig out if necessary
function go(dig)
-- refuel
$ brew doctor
Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to
fail. You may need to move this file out of the way to compile CMake.
Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!
$ brew --config
@NelsonMinar
NelsonMinar / enchant.lua
Created April 23, 2013 02:02
Minecraft ComputerCraft turtle function that enchants books
-- Minecraft turtle function to enchant books. Requires MiscPeripherals
-- Place books in lower right slot; this will enchant them and drop them
-- in a chest below
-- Plug this routine into a melee XP bot's script to automatically generate books
-- Get a reference to the XP Peripheral API
local xp = peripheral.wrap("right")
-- enchantBook takes what level you want, returns true if successful
function enchantBook(level)
@NelsonMinar
NelsonMinar / Bug description
Created May 16, 2013 01:16
Bug report for Postgres 9.2.4:
I have a PostGIS insert/select operation that creates rows in a table.
Mostly these operations succeed, but every once in awhile one fails
with an error like
ERROR: could not open file "base/16384/24738_fsm": Invalid argument
Googling for this error shows it's occurred occasionally for other Mac
users, but I haven't seen any consistent explanation or solution.
I traced this down with the help of RhodiumToad and anders on IRC
#postgresql. Their guess was that the problem is that Postgres is
calling open() followed by free() before checking errno for open().