Skip to content

Instantly share code, notes, and snippets.

View clauswitt's full-sized avatar

Claus Witt clauswitt

View GitHub Profile
@clauswitt
clauswitt / LICENSE
Created February 5, 2014 10:36 — forked from joerayme/LICENSE
Copyright (c) 2013 Couller Ltd. and Joseph Ray
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@clauswitt
clauswitt / test.asm
Created March 26, 2014 13:08
quick assembly program
section .text
global mystart
mystart:
push dword mymsg
push dword 1
mov eax, 0x4
sub esp, 4
int 0x80
@clauswitt
clauswitt / keybase.md
Created May 9, 2014 20:49
keybase.md

Keybase proof

I hereby claim:

  • I am clauswitt on github.
  • I am clauswitt (https://keybase.io/clauswitt) on keybase.
  • I have a public key whose fingerprint is 8E47 C47B 1788 B69B 9D87 A8AD 8624 6833 2B6D B274

To claim this, I am signing this object:

@clauswitt
clauswitt / reddit-likes.js
Created May 13, 2014 08:20
Quick append a tags for reddit likes to specific node
function appendUserRedditLikesToNode(username, node) {
$.getJSON('http://www.reddit.com/user/'+username+'/liked.json?jsonp=?&limit=10', {}, function(data) {
var atags = data.data.children.map(
function(item) {
return $('<a href="'+item.data.url+'">'+item.data.title+'</a>');
}
);
$(node).append(atags);
}
);
@clauswitt
clauswitt / pumpdenfunkbot.coffee
Created May 23, 2014 10:01
Pump Den Funk Bot
# Description:
# Pump den funk
#
# Dependencies:
# None
#
# Configuration:
#
#
# Commands:
@clauswitt
clauswitt / f.sh
Last active August 29, 2015 14:04
sox convert files from aif to wav (with a filename change as well) recursively from current dir
#!/bin/zsh
OLDIFS=$IFS
IFS=$'\n'
for file in `find . -name '[0-9]*_[0-9a-z]*aif'`; do
dir=`dirname "$file"`
base=`basename "$file"`
wav_base=`echo "$base" | cut -d '-' -f1`
sox "$file" $dir/$wav_base.wav
done
IFS=$OLDIFS
@clauswitt
clauswitt / catclone.c
Created January 2, 2015 09:47
A simple (dumbed down) cat clone
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
FILE *read_this;
if (isatty(fileno(stdin))) {
if(argc > 1) {
printf("filename: %s\n", argv[1]);
read_this = fopen(argv[1], "r");
(defun open-org-dir ()
"Opens the org dir"
(interactive)
(find-file "~/Dropbox/org/")
)
(defun gtd-inbox ()
"Open the gtd inbox"
(interactive)
(find-file "~/Dropbox/org/inbox.org")
)
(evil-leader/set-key "oo" 'open-org-dir)
(evil-leader/set-key "oa" 'my-org-archive-done-tasks)
(evil-leader/set-key "og" 'gtd)
(evil-leader/set-key "oj" 'journal)
(evil-leader/set-key "ot" 'org-capture)
(evil-leader/set-key "on" 'notes)
(evil-leader/set-key "oG" 'groceries)
(evil-leader/set-key "oi" 'gtd-inbox)
(evil-leader/set-key "oI" 'gtd-inbox-txt)
(evil-leader/set-key "oU" 'org-mobile-push)
@clauswitt
clauswitt / trim.cpp
Created July 22, 2015 11:30
Trim a string with boost
#include <iostream>
#include <string>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/trim_all.hpp>
int main() {
std::string result;
std::string str01 = " this is a string with something to trim ";