Skip to content

Instantly share code, notes, and snippets.

View dbourkey's full-sized avatar

David J. Bourke dbourkey

  • London
View GitHub Profile
@gelldur
gelldur / emulator-fix
Created November 15, 2016 08:46
Fix for android emulator -noaudio and CPU problems
#!/bin/bash
# http://stackoverflow.com/a/35822173/1052261
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
@chopachom
chopachom / proxy.go
Created July 26, 2012 13:18 — forked from vmihailenco/proxy.go
Simple TCP proxy in Golang
package main
import (
"encoding/hex"
"flag"
"fmt"
"log"
"net"
)
@PhirePhly
PhirePhly / memdjpeg.c
Created July 10, 2012 02:33
A bare-bones example of how to use jpeglib to decompress a jpg in memory.
// memdjpeg - A super simple example of how to decode a jpeg in memory
// Kenneth Finnegan, 2012
// blog.thelifeofkenneth.com
//
// After installing jpeglib, compile with:
// cc memdjpeg.c -ljpeg -o memdjpeg
//
// Run with:
// ./memdjpeg filename.jpg
//