This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys, re | |
infunction=False | |
currfunc="" | |
funclines=[] | |
functions={} | |
for line in sys.stdin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define SHOW_EXPRESSION() std::cout << __PRETTY_FUNCTION__ << std::endl | |
namespace expr | |
{ | |
template<typename E> float Eval(E const &e) { return e.eval(); } | |
float Eval(float e) { return e; } | |
struct val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
namespace quaternion { | |
namespace imaginary { | |
// rules for calculating quaternion imaginaries | |
// ij = k | |
// ik = j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DecorateSortUniq where | |
import Data.List | |
decorateSortUniq :: Ord a => [a] -> [a] | |
decorateSortUniq = map snd . sortBy (\(a,_) (b,_)->compare a b) . uniq snd . sortBy (\(_,a) (_,b)->compare a b) . zip [0..] | |
where uniq f (x:y:xs) = if f x == f y then uniq f (x:xs) else x:uniq f (y:xs) | |
uniq _ (x:_) = [x] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Marcus Fritzsch, July 2014 | |
import os.path | |
import sys | |
import glob | |
from tempfile import mkdtemp | |
from email.parser import Parser | |
from email.generator import Generator | |
from subprocess import check_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This was hacked up by Marcus Fritzsch, @znephf | |
// | |
// Please make sure this does what you think it does, as I am not | |
// responsible for any damage it might cause. | |
// | |
// TODO: | |
// - Profiles: check what is played and fix settings accordingly | |
// - Setting Profiles from file | |
// - Browser interface through HTTP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/zsh | |
# Get llvm, clang and compiler-rt from these locations: | |
#INSTALL#http://llvm.org/git/llvm.git#llvm | |
#INSTALL#http://llvm.org/git/clang.git#llvm/tools/clang | |
#INSTALL#http://llvm.org/git/lldb.git#llvm/tools/lldb | |
#INSTALL#http://llvm.org/git/compiler-rt.git#llvm/projects/compiler-rt | |
if [ "$1" = "get" ] || [ "$1" = "install" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Install pebble SDK in ~/opt/$pebble-sdk-rootdir-name and apply some patches | |
# This method of installing still worked as of 20150-05-04 | |
# Usage: $0 "$pebble-sdk-tarball" | |
set -e | |
tar -C ~/opt -xvf "$1" | |
tar -tf "$1" | head -n1 | read d | |
cd ~/opt/$d | |
tc=http://assets.getpebble.com.s3-website-us-east-1.amazonaws.com/sdk/arm-cs-tools-ubuntu-universal.tar.gz | |
sdkp=${1:h}/${tc:t} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
def main(): | |
out = {} | |
for fn in sys.argv[1:]: | |
ext=fn.split('.',1)[0] | |
with open(fn) as inp: | |
in_deps=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua5.2 | |
local cryield = coroutine.yield | |
local crwrap = coroutine.wrap | |
function map(f, xs) | |
return crwrap(function() | |
for v in xs do | |
cryield(f(v)) | |
end |
OlderNewer