Skip to content

Instantly share code, notes, and snippets.

@jvns
jvns / main.clj
Created Apr 2, 2012 — forked from lynaghk/main.clj
Cassowary constraint solver in ClojureScript
View main.clj
;;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 Oct 16, 2012 — forked from dergachev/README.md
Vagrant tutorial
View README.md

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 Mar 16, 2013
Processing program to play bytes from the serial port as music
View musicfromserial.processing
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 Apr 15, 2013
histogram example
@jvns
jvns / _.md
Created Apr 17, 2013
boxplot-test
View _.md
@jvns
jvns / index.html
Last active Dec 17, 2015
snake in d3
View index.html
<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 Dec 17, 2015
exploding javascripts
View exploding.css
rect.snake {
fill: #555353;
}
rect.food {
fill: #45720B;
}
svg {
height: 100%;
@jvns
jvns / _.md
Created Sep 16, 2013
piechart-test
@jvns
jvns / broken-stack-code.c
Created Oct 1, 2013
Do a weird thing with the stack in C
View broken-stack-code.c
#include <stdio.h>
void set_strings(char*** strings) {
char* strs[] = {"banana"};
*strings = strs;
}
int main() {
char** strings;
set_strings(&strings);