Skip to content

Instantly share code, notes, and snippets.

View gerardpaapu's full-sized avatar
🏠
Working from home

Gerard Paapu gerardpaapu

🏠
Working from home
View GitHub Profile
html, body {}
You have been contacted by the anthropologist Prof. Enoch W. Tormey II, who says that he has made a discovery of "utmost fascination and urgency". He bids you visit him in his newly acquired estate, in Bearwich.
Could this be the old Bärenwald estate?
Professor Tormey disappeared from the academic community suddenly and without warning 6 years ago, while investigating folk-tales in Germany. Whatever his discovery (perhaps he has discovered a tale of an even *larger* turnip), the curiousity of his absence and re-emergence are enough to bring you to this salty little part of New England.
The village of Bearwich cuts a sad grey shape from the sky, as your ship pulls in to port you wonder to yourself if the worse tragedy would be to die here or merely to live here.
A number of strange looking folk disembark with you, eyeing them suspiciously you wonder if they are here for the Professor's revelation though many in the group look too coarse to be academics.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Globalization;
using Facebook;
namespace PhosphorUsercontrols
{
public class FacebookPostLink {
<script src="http://localhost:8089/loader.js" ></script>
<script>
new Poll({
id: "harry-potter-question",
question: "Which is the best Harry Potter",
answers: ["The first one", "The second one", "The Emperor Strikes Back"]
}).load();
</script>
<!doctype HTML>
<head>
<link href="styles.css" type="text/css" rel="stylesheet" />
</head>
<div id="widget">
<div class="wrap">
<div id="rating">&#x2605;&#x2605;&#x2605;&#x00bd;&nbsp;</div>
<div id="controls"
style="display: none"
@gerardpaapu
gerardpaapu / html-string.js
Created June 12, 2012 05:34
Wrap Strings that represent html to provide sanitation
function HTMLString (value, safe) {
if (value instanceof HTMLString)
return value;
if (!this instanceof HTMLString)
return new HTMLString(value, safe);
if (arguments.length < 1)
return this;
using System;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Net;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
@gerardpaapu
gerardpaapu / OrderedSet.chitchat
Created July 3, 2012 04:03
An example of chitchat code and the javascript it compiles to
;;; OrderedSet
;;; ----------
;;;
;;; A Collection class that wraps an Array.
;;; It maintains immutability, an order, and
;;; does not contain duplicates
;;;
;;; Items of the Ordered Set should implement 'Ord'
(class OrderedSet
(constructor (items, ordered, distinct)

I love Coffeescript, but write Javascript

This is an example of why even though I love coffeescript, I still frequently write code in raw javascript.

This is the coffeescript I originally had:

pairs = []
// just thinking about using closures to expose
// interface and conceal implementation after
// reading some stuff about lisp, and animation
// came to mind
function doNothing () {}
function createAnimationContext (framerate) {
// framerate should be in frames per second
// interval must be in ms per frame