Skip to content

Instantly share code, notes, and snippets.

@bouk
bouk / index.html
Created September 8, 2015 15:22
Perlin Noise
<!DOCTYPE html>
<html>
<head>
<style>
* {
padding:0;
margin:0;
}
#canvas {
width:400px;
@bouk
bouk / index.html
Created September 8, 2015 15:22
Maps Overlay
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
height:100%
}
body {
height:100%;
@bouk
bouk / bench_test.go
Last active September 1, 2015 14:56 — forked from SchumacherFM/bench_test.go
GoLang Benchmark: Map, StringSlice, Array, StructSlice
package main
// run with: $ go test --bench=. -test.benchmem .
// @see https://twitter.com/karlseguin/status/524452778093977600
import (
"math/rand"
"strconv"
"testing"
)
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
</head>
<body>
<canvas id="screen" width=640 height=640></canvas>
<script>
var step = 0;
function render(x, y, t) {
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
</head>
<body>
<canvas id="screen" width=640 height=640></canvas>
<script>
var step = 0;
function render(x, y, t) {
@bouk
bouk / dope.html
Last active August 29, 2015 14:09
html
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<style>*{margin:0;padding:0;}</style>
</head>
<body>
<canvas id="screen" width=1920 height=1080></canvas>
<script>
var step = 0;
var width=1920;
@bouk
bouk / boggle.rs
Last active August 29, 2015 14:07
Boggle solver
#![allow(dead_code)]
use std::path::posix::Path;
use std::io::fs::File;
use std::io::{BufferedReader, Reader, stdin};
use std::vec::Vec;
use std::collections::{Set, HashSet, MutableSet, Bitv};
use std::cmp::{min, max};
type Grid = Vec<String>;
package main
import (
"fmt"
"reflect"
)
func main() {
a := []int{1, 2, 3, 4}
@bouk
bouk / index.html
Last active August 29, 2015 14:00 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
background: #000;
}
</style>
<body>
FROM ubuntu
RUN apt-get install -y wget
RUN wget -O - http://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz | tar xzf - -C /usr/local/
RUN ln -s /usr/local/go/bin/go /usr/local/bin/go
RUN ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
RUN ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc