Skip to content

Instantly share code, notes, and snippets.

fhtagn unfo

Block or report user

Report or block unfo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View graph.rs
pub struct Vertice {
pub source: int,
pub target: int,
pub weight: int,
}
pub struct Node {
pub id: int,
pub vertices: Vec<Vertice>,
}
View dijkstra-vs-astar-no-heuristic.md

Dijkstra

File reading: 18 ms
JSON parse:   2243 ms
Vertex parse: 1818 ms
Find routes:  9468 ms
----
Total time:   13548 ms
View unfo-feedly.opml
<?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/"/>
View car
سَيّارة
سيارة
@unfo
unfo / ip.rs
Created May 15, 2015
hyper client response does not implement read_to_string
View ip.rs
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();
View gist:266062
(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 Mar 5, 2012
Extend TRAC ticket view to be 80% wide
View trac-ticket.user.js
// ==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 Apr 24, 2012
Interleave two different datapoint count csv files to fill all minutes of a day
View all-minutes.sh
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`
View percentage.py
#!/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)
View shl 8
|----------------- eax -----------------|
|-- ah -| |-- al -|
0001 0001 1000 1000 0000 0000 1111 1111
<< 8
1000 1000 0000 0000 1111 1111 0000 0000
You can’t perform that action at this time.