Skip to content

Instantly share code, notes, and snippets.

import re
import argparse
def get_iwlist_format():
def group1(o):
return o.group(1)
def group1_int(o):
return int(o.group(1))
#include <iostream>
#include <tpie/file_stream.h>
using namespace std;
using namespace tpie;
int main() {
tpie_init();
{
file_stream<int> infile;
@Mortal
Mortal / keybase.md
Created February 23, 2015 18:19
Woo, everyone get on the keybase train

Keybase proof

I hereby claim:

  • I am mortal on github.
  • I am ravv (https://keybase.io/ravv) on keybase.
  • I have a public key whose fingerprint is 9722 E25A D097 620C FA15 CC66 4770 F95A EC3F 673C

To claim this, I am signing this object:

@Mortal
Mortal / kasseplot.py
Created September 14, 2015 06:50
kasseplot.py
import requests
import matplotlib.pyplot as plt
def main():
data = requests.get('http://enkasseienfestforening.dk/timetrial/json/').json()
fig, ax1 = plt.subplots()
ax1.set_ylim(0, 5)
xmax = 90
ax1.set_xlim(0, xmax / 5)
@Mortal
Mortal / gist:791193
Created January 22, 2011 15:54
Minecraft server behind firewall
camel15:rav:~/workspace/mc% java -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer
! 16:50:11 ######################### WARNING #########################
! 16:50:11 verify-names is set to false! This means that anyone who
! 16:50:11 connects to this server can choose any username he or she
! 16:50:11 wants! This includes impersonating an OP!
! 16:50:11 If you wish to fix this, edit server.properties, and change
! 16:50:11 verify-names to true.
! 16:50:11 ###########################################################
16:50:11 Setting up
16:50:11 Loading level
@Mortal
Mortal / hypem-download.user.js
Created August 11, 2011 14:21
Download music from Hype Machine
var cs = soundManager.createSound;
soundManager.createSound = function () {
var r = cs.apply(this, arguments);
document.getElementById("player-links").innerHTML =
'<a href="'+r.url+'" download style="color: white; font-size: 12px; font-weight: bold">Download</a>';
return r;
}
@Mortal
Mortal / buildlog1
Created December 20, 2011 17:29
TPIE build troubles
Scanning dependencies of target tpie
[ 1%] Building CXX object tpie/CMakeFiles/tpie.dir/key.cpp.o
[ 2%] Building CXX object tpie/CMakeFiles/tpie.dir/backtrace.cpp.o
[ 4%] Building CXX object tpie/CMakeFiles/tpie.dir/cpu_timer.cpp.o
[ 5%] Building CXX object tpie/CMakeFiles/tpie.dir/file_count.cpp.o
[ 7%] Building CXX object tpie/CMakeFiles/tpie.dir/execution_time_predictor.cpp.o
[ 8%] Building CXX object tpie/CMakeFiles/tpie.dir/fractional_progress.cpp.o
[ 10%] Building CXX object tpie/CMakeFiles/tpie.dir/job.cpp.o
[ 11%] Building CXX object tpie/CMakeFiles/tpie.dir/logstream.cpp.o
[ 13%] Building CXX object tpie/CMakeFiles/tpie.dir/memory.cpp.o
@Mortal
Mortal / gist:1521056
Created December 26, 2011 12:20
CSS legend
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Legend</title>
<style type="text/css">
ul, li {
margin: 0; padding: 0; list-style-type: none;
}
li:before {
@Mortal
Mortal / sloccount
Created January 23, 2012 17:48
Simple sloccount
#!/bin/sh
find $* -name '*.h' -or -name '*.cpp' -or -name '*.inl' |xargs cat | sed -e 's/\/\/.*//; s/^[ \t]*//' | grep . | wc
@Mortal
Mortal / out
Created February 16, 2012 19:46
Solution
After 27291131911 attempts.
The badness is:
1026
The result is:
0 -> 14: 3 4
1 -> 13:
2 -> 20: 2
3 -> 20: 2
4 -> 14: 0 4
5 -> 14: 0 4