Skip to content

Instantly share code, notes, and snippets.

@wylieconlon
wylieconlon / gist:1286265
Created October 14, 2011 04:40
Canvas animation with requestAnimationFrame and mouse tracking for games
var Animator = (function() {
var container,
canvas, ctx,
w, h,
offsetLeft, offsetTop,
lastX, lastY;
var init = function(el, options) {
container = el;
@wylieconlon
wylieconlon / boundedqueue.py
Created February 11, 2012 05:32
Queue with fixed maximum length
#!/usr/bin/env python
# This bounded queue is implemented as a doubly-linked list with an additional size
# parameter. This enables O(1) time efficiency for the enqueue and dequeue
# operations, as these operations only operate on the first and last nodes.
#
# This may not have optimal space efficiency because of the double pointers in
# each node, but it is a tradeoff for maximum time and throughput. The queue
# never examines nodes in the middle of the list, so it uses a minimal amount
# of memory throughput.
@wylieconlon
wylieconlon / high-dpi-media.css
Created August 24, 2012 22:05 — forked from marcedwards/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* -------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs with IE zoomed in */
/* - Android hdpi devices and above */
/* - Android tvdpi devices, including Google Nexus 7 */
Afghanistan
Afghan
Albania
Algeria
Andorra
Angola
@wylieconlon
wylieconlon / currencies.json
Last active December 15, 2015 14:59
List of currency codes and countries that use them, from ISO 4217 http://en.wikipedia.org/wiki/ISO_4217
{
"AED": ["United Arab Emirates"],
"AFN": ["Afghanistan"],
"ALL": ["Albania"],
"AMD": ["Armenia"],
"ANG": ["Curaçao", "Sint Maarten"],
"AOA": ["Angola"],
"ARS": ["Argentina"],
"AUD": ["Australia", "Australian Antarctic Territory", "Christmas Island", "Cocos Islands", "Heard and McDonald Islands", "Kiribati", "Nauru", "Norfolk Island", "Tuvalu"],
"AWG": ["Aruba"],
@wylieconlon
wylieconlon / smart_host_api.txt
Created March 7, 2014 00:07
API sample for Smart Host
# example API requests
#
# http://www.smarthost.me/api/1.0/price/?address=412 E 9th St, New York, NY&private_room=true&entire_home=false&occupancy=2
# http://www.smarthost.me/api/1.0/price/?address=brooklyn&private_room=true&entire_home=false&occupancy=2
{
"average": 113.07379375591296,
"city": "New York",
"count": 1057,
"latitude": 40.64522171020508,
<!DOCTYPE html>
<html>
<head>
<title>MyFace project</title>
<link href="https://fonts.googleapis.com/css?family=Bree+Serif|Open+Sans" rel="stylesheet">
</head>
<body>
<div class="container">
<img src="https://pbs.twimg.com/profile_images/899373060964352000/j14RRZaJ.jpg">
<h1>Wylie Conlon</h1>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div class="top">
Current value of color:
<span class="output"></span>
</div>
@wylieconlon
wylieconlon / parser.js
Created September 18, 2018 22:19
Lisp Parser
const TOKENS = {
START: 'start',
END: 'end',
};
function tokenize(code) {
let current = 0;
let startOfToken;
let tokens = [];
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Visu interessante",
"data": {
"format": {
"property": "aggregations.sube.buckets"
},
"values": {
"took": 29,
"timed_out": false,