Skip to content

Instantly share code, notes, and snippets.

View Pallinder's full-sized avatar
😀
Working

David Pallinder Pallinder

😀
Working
View GitHub Profile
@Pallinder
Pallinder / gist:aa57c47b374efe1c43e8
Last active August 29, 2015 14:02
Sillynames in swift
import Cocoa
extension Array {
func random() -> T {
var r = arc4random_uniform(UInt32(self.count))
return self[Int(r)]
}
}
class SillyName {
let adjectives = ["Black", "White", "Gray", "Brown", "Red", "Pink", "Crimson", "Carnelian", "Orange", "Yellow", "Ivory", "Cream", "Green"]
@Pallinder
Pallinder / .bash_profile
Created September 3, 2013 17:29
Getting golang + mac os x + gdb to play nicely
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'
@Pallinder
Pallinder / fish.config
Created June 7, 2012 22:26
Add current git branch to fish
function parse_git_dirty
git diff --quiet HEAD ^&-
if test $status = 1
echo (set_color $fish_git_dirty_color)"Δ"(set_color normal)
end
end
function parse_git_branch
# git branch outputs lines, the current branch is prefixed with a *
set -l branch (git rev-parse --abbrev-ref HEAD)
@Pallinder
Pallinder / html5video.sh
Created September 28, 2011 09:35 — forked from markupboy/html5video.sh
automated conversion of a file to all three html5 compatible video formats - h.264, ogg, and webm
#!/bin/sh
####################################
# Output file for HTML5 video #
# Requirements: #
# - handbrakecli #
# - ffmpeg #
# - ffmpeg2theora #
# #
# usage: #
@Pallinder
Pallinder / alert.c
Created June 22, 2011 10:56
Alert after command has finished, lifehack.
/*
* Small hack I usually keep around, mainly use it like so (after placing it in my path)
* ./big_task_that_takes_a_while_to_run ; alert
* Once the task is done a small sound will be played letting you know its finished and you will no longer have to
* keep tabbing back to your console window to check if your process has finished or not.
* Released in public domain (all 5 rows of it)
*/
#include <stdio.h>
int main(void) {