Skip to content

Instantly share code, notes, and snippets.

-- We only need the config module
tarn_loadmodule("config")
-- Configure the display window
tarn_display_width = 40
tarn_display_height = 25
tarn_display_title = "Tarn"
tarn_init()
-- Globally accessible variables
-- Rules:
-- Winit(p) = rand[0,100) < 40
-- Repeat 4: W?(p) = R1(p) >= 5 || R2(p) == 2
-- Repeat 3: W?(p) = R1(p) >= 5
function ca_cave(map)
local R = function (s, p)
local ret = 0
local rt = {}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Dynamic CSS
</title>
<style type="text/css">
/* None */
@jdp
jdp / jquery.layer.js
Created December 9, 2008 21:47
A simple way to make a centered layer with jQuery
/*
* jQuery jquery.layer.js
* Copyright (c) 2008 Justin Poliey <jdp34@njit.edu>
* A simple inline layer function for jQuery
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@jdp
jdp / haml.lua
Created December 15, 2008 13:30
Beginnings of a basic HAML subset for Lua
require "tprint"
raw_haml = [[%a
%b
%a
%b
%c]]
-- Generate a list of HAML rules
rules = {}
@jdp
jdp / io.lang
Created January 2, 2009 09:22
gedit language file for io
<?xml version="1.0" encoding="UTF-8"?>
<language id="io" _name="Io" version="2.0" _section="Scripts">
<metadata>
<property name="mimetypes">application/x-io;text/x-io</property>
<property name="globs">*.io</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
@jdp
jdp / JsonParser.io
Created January 3, 2009 03:13
Simple JSON parser for Io
/*
* JsonParser.io
* A simple JSON parser for Io
* Copyright (c) 2008 Justin Poliey <jdp34@njit.edu>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
stdClass Object
(
[results] => Array
(
[0] => stdClass Object
(
[text] => #chirp collegehumor.1703899c3fe4ada5da7fb78378b86c9a.jpg (JPEG Image, 480x360 pixels) http://bit.ly/mhX8
[to_user_id] =>
[from_user] => hanggliding
[id] => 1130751942
<?php
define('DEBUG', true);
// configure curl for twitter
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
//curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
// example search for #chirp hashtag with bit.ly from dan
$api_url = 'http://search.twitter.com/search.json?q=%23chirp+bit.ly&from=hanggliding';
<?php
/**
* Chirp 'people' API method
* @author Justin Poliey <justin@magicquotesgroup.com>
* @package chirp
* @version 1.0
*/
/**
* Require base API handler