Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# https://gist.github.com/oodavid/40fa04325f2b762dfb9e
#
# 1 - Copy this file to your home directory
# 2 - Add the following line to ~/.bash_logout
# /bin/bash ~/seeyouspacecowboy.sh; sleep 1
# 3 - Add the following to ~/bashrc
# trap_exit() {
# . "$HOME/.bash_logout"
@oodavid
oodavid / .gitconfig
Created June 16, 2014 08:03
Alias for a redacted graph log. Add to ~/.gitconfig
[alias]
tree = log --graph --color --all --pretty=format:"%C(yellow)%h%C(green)%d%C(reset)%n%x20%C(blue)%cn%C(reset)%x20%cd%n%x20%s%n"
@oodavid
oodavid / version.sh
Created March 3, 2014 16:30
Git > Get changes in VERSION for tagging purposes
# Search common.php for changes in the VERSION
# Note - won't follow line changes, it always looks at line 11...
git log --all --format=format:%H -G'\$VERSION' common.php | xargs -L 1 git blame common.php -L 11,11 > ~/versions.txt
@oodavid
oodavid / Application.js
Last active August 29, 2015 13:56
Demonstration of the various easing types in GameClosure
import device;
import animate;
import ui.View as View;
import ui.TextView as TextView;
// A list of all easing types
var easings = [
'linear',
'easeInQuad',
'easeIn',
@oodavid
oodavid / nexgen.pull.sh
Last active December 27, 2015 07:39
Install NexGen Server
#!/bin/bash
#
# Install NexGen Server
# https://gist.github.com/oodavid/7290587
#
# To download
# cd /home/ubuntu/
# wget -O nexgen.pull.sh https://gist.github.com/oodavid/7290587/raw/nexgen.pull.sh
#
# To run at boot
@oodavid
oodavid / animate.js
Created October 28, 2013 11:08
GameClosure Patch > Additional Transition / Easing Functions - I couldn't find the proper repo to commit this, so just dumping into a gist for the time being.
// sdk/timestep/ui/backend/animate.js
/**
* @license
* This file is part of the Game Closure SDK.
*
* The Game Closure SDK is free software: you can redistribute it and/or modify
* it under the terms of the Mozilla Public License v. 2.0 as published by Mozilla.
* The Game Closure SDK is distributed in the hope that it will be useful,
@oodavid
oodavid / README.md
Last active December 21, 2015 10:38
Android - Compile, Install, Run and Debug

Will require tweaking for your environment as I've hardcoded some binary paths.

Requires all the usual gubbins to compile android:

  • Apache ANT
  • Android
  • Android ADB
  • Android Monitor

If you want to use this with sublime-text, then you'll need a simple build script:

@oodavid
oodavid / index.html
Last active December 18, 2015 14:58
Convert Google Spreadsheeets to JSON
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Google Spreadsheet to JSON...</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="http://jquery-csv.googlecode.com/files/jquery.csv-0.71.min.js"></script>
<script>
// Which file to load?
var csv = 'https://docs.google.com/spreadsheet/pub?key=0AmqTMmxb4MxEdE9vUHVPdWs1WjlJR1JlbFJubi14VkE&single=true&gid=0&output=csv';
@oodavid
oodavid / tumblr2jekyll.php
Last active December 15, 2015 23:59
PHP script to convert tumblr blog articles to jekyll posts, modify the settings then simply run this in your terminal: php tumblr2jekyll.php More on the blog - http://oodavid.com/2013/04/09/convert-from-tumblr-to-jekyll-using-php.html
<?php
//
// Settings
//
// Blog URL
$blog = 'oodavid.tumblr.com';
// Tumblr API key - register for one here: http://www.tumblr.com/oauth/apps
$api_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
// Local folder to write to - PHP must be able to write here
@oodavid
oodavid / Bubbler.php
Created March 19, 2013 12:11
OOP - Method and Property bubbling in PHP
<?php
/**
* BUBBLER CLASS
*
* The Magic Methods __get, __set and __call are called by PHP when the object cannot
* find or access methods or properties within the object, the Bubbler class intercepts
* these and simply routes them to their "parent" object.
*
* +--------------------------------------+
* | Object A /\ Plain Object |