Skip to content

Instantly share code, notes, and snippets.

class Songtext
def refrain(*args, &block)
if block
@refrain = block
else
if args.first[0].downcase == 'x'
puts
args.first[1..-1].to_i.times do
@refrain.call()
puts
@bouk
bouk / domineren.py
Created February 27, 2013 19:54
NIO 2012-2013 ronde 2 opdracht 0
import re
import copy
import sys
board = None
moves_done = 0
columns = 0
rows = 0
moves = []
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
struct state
{
int depth;
int parent;
#include <cstdio>
using namespace std;
int N;
int number;
bool first;
int main()
{
from bs4 import BeautifulSoup
import urllib2
def main():
page = urllib2.urlopen("http://www.weersvoorspelling.nl/weer-nederland/culemborg/per-uur/8387")
doc = BeautifulSoup(page.read())
for row in doc.find(class_='forecastTable').find_all('tr'):
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int H, k;
vector<int> houses;
bool possible(int w)
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
@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>
package main
import (
"fmt"
"reflect"
)
func main() {
a := []int{1, 2, 3, 4}
@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>;