Skip to content

Instantly share code, notes, and snippets.

View unfo's full-sized avatar

Jan Wikholm unfo

View GitHub Profile

Dijkstra

File reading: 18 ms
JSON parse:   2243 ms
Vertex parse: 1818 ms
Find routes:  9468 ms
----
Total time: 13548 ms
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>feedly from @unfo</title>
</head>
<body>
<outline text="Must Read" title="Must Read">
<outline type="rss" text="Ho/Ax (@snare)" title="Ho/Ax (@snare)" xmlUrl="http://ho.ax/feed.xml" htmlUrl="http://ho.ax//"/>
<outline type="rss" text="lcamtuf's blog" title="lcamtuf's blog" xmlUrl="http://lcamtuf.blogspot.com/feeds/posts/default" htmlUrl="http://lcamtuf.blogspot.com/"/>
سَيّارة
سيارة
@unfo
unfo / ip.rs
Created May 15, 2015 16:12
hyper client response does not implement read_to_string
extern crate hyper;
use hyper::*;
fn main() {
let mut client = client::Client::new();
let res = client.get("http://ip.nebula.fi/").send().unwrap();
println!("Got response: {:?}", res.status_raw);
let mut contents = String::new();
(take 10 (for [n (whole-numbers) :when (even? n) ] n))
= > (2 4 6 8 10 12 14 16 18 20)
@unfo
unfo / trac-ticket.user.js
Created March 5, 2012 11:07
Extend TRAC ticket view to be 80% wide
// ==UserScript==
// @name Expand my Tickets!
// @namespace http://jw.fi/
// @version 0.1
// @description Expands Trac ticket view to be 80% wide to better fit bigger resolutions
// @match https://*trac*/*
// @copyright 2012+, Jan Wikholm
// ==/UserScript==
function addStyle(style) {
@unfo
unfo / all-minutes.sh
Created April 24, 2012 12:49
Interleave two different datapoint count csv files to fill all minutes of a day
for h in {0..23}
do
for m in {0..59}
do
# .csv format:
# 00:07,2
# 00:10,17
# this combines single.csv and all csv to so that all minutes of the day are counted
# all.csv includes single.csv numbers, but we want em separate
ts=`printf "%02d:%02d" $h $m`
#!/usr/bin/python
import sys
def min_needed(percentage, decimals):
top = 1.0
bottom = 1.0
percentage = round(percentage, decimals)
current = round(100 * (top / bottom), decimals)
@unfo
unfo / shl 8
Created November 23, 2015 09:53
|----------------- eax -----------------|
|-- ah -| |-- al -|
0001 0001 1000 1000 0000 0000 1111 1111
<< 8
1000 1000 0000 0000 1111 1111 0000 0000
#date: 03/30/2005
#title: Charlie the Smiling Fish
#author: Jan Wikholm
#email: jw at jw dot fi
#comments: This was written in <6hrs once I heard I might actually have a chance at the prizes ;)
#----------------------------------------
#code:
# Hello IORCC judges.
module IORCC_entry
extend self