Skip to content

Instantly share code, notes, and snippets.

@chnn
chnn / wufoo-form-style.css
Created March 13, 2012 23:41
A style for Wufoo forms
.wufoo input.text, input.textarea {
padding: 5px;
}
@chnn
chnn / AssassinManagerTest.java
Last active December 26, 2015 09:19 — forked from kvu787/AssassinManagerTest.java
Include indents in expected printouts
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import org.junit.After;
import org.junit.Before;
@chnn
chnn / index.html
Last active December 28, 2015 23:09
Brush-like scrolling control
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="screen.css">
</head>
<body>
<div class="box">
<div class="sheet"></div>
</div>

Your syntax was effeedd up. You need to be OCD like your computer is!

Remember to include parenthesis on if statements:

void roll() {
    spaces += int(random(1, 3));
    if (spaces >= 15) {
        spaces = 15;
 }
validate :: Integer -> Bool
validate n = mod (sumDigits (doubleEveryOther (toDigits n))) 10 == 0
@chnn
chnn / index.html
Last active August 29, 2015 14:27 — forked from jfsiii/.block
I wanted to add diagonal stripes to a SVG bar chart, but wanted to a) avoid using images b) change the color via CSS
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>SVG colored patterns via mask</title>
<style>
/* FF seems to need explicit dimensions */
svg {
width: 500px;
height: 500px;
@chnn
chnn / keybase.md
Created February 4, 2016 23:56
keybase.md

Keybase proof

I hereby claim:

  • I am chnn on github.
  • I am chnn (https://keybase.io/chnn) on keybase.
  • I have a public key ASC_1Ziwj96Ttfucz6jKiUYcLtQb0iExS_BLxr-vhSnlhQo

To claim this, I am signing this object:

"""Simulates expected wait time for a scenario involving 2 trains.
The problem is stated in Exercise 5.6.8 of Colley's _Vector Calculus_:
Suppose that you commute every day to work by subway. You walk to the same
subway station, which is served by two subway lines, both stopping near
where you work. During rush hour, each subway line sends trains to arrive
at the stop every 6 minutes, but the dispatchers begin the schedules at
random times. What is the average time you expect to wait for a subway
train?
@chnn
chnn / components.task-button.js
Last active June 1, 2016 13:57
Sketching out an “async button” using ember-concurrency
import Ember from 'ember';
import layout from '../templates/components/task-button';
const { Component, computed } = Ember;
/**
A button whose state is derived from an [ember-concurrency task][0].
Suppose in some template context, you have access to the `eggs` and `kale`
@chnn
chnn / -
Created June 23, 2016 20:24
diff --git a/Vagrantfile b/Vagrantfile
index 1210469..9db4bf7 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -34,6 +34,7 @@ Vagrant.configure("2") do |config|
a.playbook = "ansible/site.yml"
a.inventory_path = "ansible/local"
a.limit = "all"
+ a.verbose = "vvvv"
# a.raw_ssh_args = ['-o User=h2ometrics', '-o IdentityFile=~/.ssh/id_rsa']