Skip to content

Instantly share code, notes, and snippets.

View porty's full-sized avatar

Robert McNeil porty

View GitHub Profile
@porty
porty / sh.txt
Created April 7, 2014 06:52
Sexual Healing
Ooh, now let's get down tonight
Baby I'm hot just like an oven
I need some lovin'
And baby, I can't hold it much longer
It's getting stronger and stronger
And when I get that feeling
I want Sexual Healing
Sexual Healing, oh baby
Makes me feel so fine
@porty
porty / coding_tunes.md
Created May 24, 2014 00:59
Coding tunes

Flux Pavilion - I Can't Stop

@porty
porty / network_throttling_on_linux.md
Last active August 29, 2015 14:04
Network throttling on Linux

Latency

tc qdisc add dev INTERFACE root netem delay 50ms

Packet loss

tc qdisc add dev INTERFACE root netem loss 50%

Bandwidth

@porty
porty / main.go
Last active August 29, 2015 14:05
Emitter
package main
import (
"bufio"
"fmt"
"io"
"os"
"github.com/porty/emitter"
)
@porty
porty / README.md
Last active November 1, 2016 00:29
Ruby method call display

Ruby Method Call Display Thing

Displays what methods are getting called, with what arguments, and their return values or exceptions thrown.

You just have to include Hax in the class you want to look at

This will probably break if your method is expecting a block

$ ruby example.rb
@porty
porty / building.md
Last active August 29, 2015 14:07
Doom Legacy on Mac

Extract source tarball, run make:

$ make
make: sdl-config: Command not found
g++ -std=c++11 -Wall -MP -MMD -g -O0 -mwindows -D__WIN32__ -DSDL -DNO_MIXER  -Iinclude -c src/engine/g_game.cpp -o build/engine/g_game.o
clang: error: unknown argument: '-mwindows'
make: *** [build/engine/g_game.o] Error 1
@porty
porty / osx_tray_icon.go
Last active August 29, 2015 14:13
OSX Tray Icon in Go
package main
// http://www.cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
// https://github.com/TooTallNate/NodObjC/blob/master/examples/NodeCocoaHelloWorld.app/Contents/MacOS/app.js
// https://github.com/TooTallNate/NodObjC/issues/21
// http://www.gnustep.it/nicola/Tutorials/FirstGUIApplication/node3.html
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
@porty
porty / ?.sh
Last active August 29, 2015 14:13
Create a minecraft server
# install sudo
apt-get install -y sudo
# allow users to do sudoey things
# change network interface things
@porty
porty / shell.sh
Last active January 5, 2016 04:35
Buildkite interactive shell
#!/bin/bash
set -e
if [[ $(whoami) != "buildkite-agent" ]]; then
cp $(basename $0) /tmp/shell.sh
sudo su buildkite-agent -s /tmp/shell.sh
exit $?
fi
@porty
porty / debug.php
Created March 28, 2017 00:36
How to debug in php
<?php
private function log($args)
{
$str = '';
foreach ($args as $arg) {
if (is_string($arg)) {
$str .= $arg;
} else {
ob_start();