Skip to content

Instantly share code, notes, and snippets.

@jvns
jvns / main.clj
Created April 2, 2012 02:55 — forked from lynaghk/main.clj
Cassowary constraint solver in ClojureScript
;;Using the Cassowary constraint solver from ClojureScript
;;This demo shows using multimethods for readable constraint syntax using +, -, and =.
;;Output is a row of circles with random radii spaced so that the space between their boundaries is uniform.
(ns c2.main
;;refer-clojure :exclude is currently broken in ClojureScript master
;;Ticket open: http://dev.clojure.org/jira/browse/CLJS-114
;;Fix applied here: https://github.com/lynaghk/clojurescript/tree/114-refer-clojure-exclude
(:refer-clojure :exclude [+ - =])
@jvns
jvns / README.md
Created October 16, 2012 17:57 — forked from dergachev/README.md
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@jvns
jvns / musicfromserial.processing
Created March 16, 2013 02:00
Processing program to play bytes from the serial port as music
import ddf.minim.*;
import ddf.minim.ugens.*;
import processing.serial.*;
Serial myPort; // The serial port
Minim minim;
AudioOutput out;
Oscil osc;
void setup() {
minim = new Minim( this );
out = minim.getLineOut( Minim.MONO, 2048 );
@jvns
jvns / _.md
Created April 15, 2013 14:37
histogram example
@jvns
jvns / _.md
Created April 17, 2013 20:15
boxplot-test
@jvns
jvns / _.md
Created May 4, 2013 02:48
snake
@jvns
jvns / index.html
Last active December 17, 2015 00:00
snake in d3
<html>
<head>
<title> it's a snake! </title>
<link rel="stylesheet" href="snake.css"> </link>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script>
<script src="snake.js"> </script>
</head>
<body>
@jvns
jvns / exploding.css
Last active December 17, 2015 02:48
exploding javascripts
rect.snake {
fill: #555353;
}
rect.food {
fill: #45720B;
}
svg {
height: 100%;
@jvns
jvns / _.md
Created September 16, 2013 23:37
piechart-test
@jvns
jvns / broken-stack-code.c
Created October 1, 2013 01:39
Do a weird thing with the stack in C
#include <stdio.h>
void set_strings(char*** strings) {
char* strs[] = {"banana"};
*strings = strs;
}
int main() {
char** strings;
set_strings(&strings);