Skip to content

Instantly share code, notes, and snippets.

@PkmX
PkmX / nexus5.xml
Created May 25, 2015 03:48
Nexus 5 Lens Calibration
<lensdatabase version="1">
<camera>
<maker>LGE</maker>
<model>Nexus 5</model>
<mount>lgeNexus5</mount>
<cropfactor>7.61</cropfactor>
</camera>
<lens>
<maker>LGE</maker>
@PkmX
PkmX / lab10-test
Created June 3, 2015 03:33
OSDI Lab10 Test
#!/bin/sh
set -e
set -x
RAMDISK_DEVICE=/dev/ram0
RAMDISK_PATH=/ram0
do_mount() {
mount $RAMDISK_DEVICE $RAMDISK_PATH
@PkmX
PkmX / main.cpp
Last active August 29, 2015 14:22
#include <functional>
#include <iostream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <tuple>
#include <experimental/tuple>
#include <boost/variant.hpp>
namespace std {
// "License": Public Domain
// I, Mathias Panzenb�ck, place this file hereby into the public domain. Use it at your own risk for whatever you like.
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it
// an example on how to get the endian conversion functions on different platforms.
#ifndef PORTABLE_ENDIAN_H__
#define PORTABLE_ENDIAN_H__
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__)
@PkmX
PkmX / init
Created June 15, 2015 12:44
OSDI Lab12 init
#!/sbin/busybox sh
set -e
/sbin/busybox --install -s
chown -R 0:0 /
mount -t proc proc /proc
mount -t sysfs sysfs /sys
Dungeon Crawl Stone Soup version 0.16.1 (tiles) character file.
1487256 xtyrian the Slayer (level 27, 196/196 HPs)
Began as a Gargoyle Fighter on June 27, 2015.
Was the Champion of Okawaru.
Escaped with the Orb
... and 3 runes on June 28, 2015!
The game lasted 07:35:20 (97735 turns).
@PkmX
PkmX / morgue.txt
Created February 10, 2016 20:50
GrFi^Pakellas
Dungeon Crawl Stone Soup version 0.18-a0-1212-g3cecdf7 (tiles) character file.
10244935 pkmx the Invulnerable (level 27, 199/199 HPs)
Began as a Gargoyle Fighter on Feb 10, 2016.
Was the Champion of Pakellas.
Escaped with the Orb
... and 15 runes on Feb 11, 2016!
The game lasted 13:37:14 (164467 turns).
Dungeon Crawl Stone Soup version 0.18-a0-1212-g3cecdf7 (tiles) character file.
1315647 pkmx the Demonologist (level 26, 182/182 HPs)
Began as a Gargoyle Summoner on Feb 12, 2016.
Was the Champion of Sif Muna.
Escaped with the Orb
... and 3 runes on Feb 13, 2016!
The game lasted 09:29:09 (109962 turns).
@PkmX
PkmX / loeb.md
Last active January 9, 2019 15:59
Löb with error handling

Löb with error handling

löb is a well-known function in Haskell for implementing spreadsheet-like behaviors and tying the knot. It is defined as:

loeb :: Functor f => f (f a -> a) -> f a
loeb fs = xs
  where xs = fmap ($ xs) fs
@PkmX
PkmX / DynT.hs
Last active March 30, 2016 19:50
DynT
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeSynonymInstances #-}
module Data.DynT where