Skip to content

Instantly share code, notes, and snippets.

View sukima's full-sized avatar

Devin Weaver sukima

View GitHub Profile
@gwright
gwright / features
Created April 3, 2014 19:35
ruby script to summarize local branch status relative to origin
#!/usr/bin/env ruby
#require 'pry'
#require 'pry-byebug'
def branch(group:nil)
case group
when :remote
flag = "-r"
when :all
#!/bin/bash
tmpdir=`mktemp -dt ios-sim.XXX`
buildpath="./build/Release/ios-sim"
destdir="$HOME/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/iphone"
success=false
pushd $tmpdir
git clone [email protected]:phonegap/ios-sim.git .
@alivesay
alivesay / uuidv4.js
Last active January 3, 2016 00:19
Fast Javascript RFC-compliant UUID generator.
/**
* Generates an RFC4122-compliant v4 UUID.
* @returns {string}
*/
function generateUUID() {
var timestamp = Date.now(), uuid = '', i = 36, c,
hexChars = '0123456789abcdef',
uuidPattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
while (i--) {
// PinkySwear - Minimalistic implementation of the Promises/A+ spec
//
// Public Domain. Use, modify and distribute it any way you like. No attribution required.
//
// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
//
// https://github.com/timjansen/PinkySwear.js
//
// Modified to add resolve/reject/notify/process/fin/done/fail/get/invoke methods
(function(target) {
@sukima
sukima / encrypt.rb
Created October 12, 2013 04:04
A Jekyll plugin to encrypt sensitive data from spammers and bots.
#
# Author: Devin Weaver
#
# Encrypts a block and outputs in line JavaScript to decrypt on the fly. Used
# for hiding sensitive information like email and phone numbers that you want
# visiters to see but do not want spiders or robots to see (keep from search
# engines and spammers). HTML only allowed in block.
#
# If you store the Jekyll source publicly (like on Github) You can avoid
# putting sensitive data inside a `_secrets.yml` file and look them up by id.
@Stuk
Stuk / exec.js
Created August 14, 2013 00:15
Wrap Node's `child_process.spawn` with a promise interface that rejects if the process has an error, or exits with a code other than zero.
var spawn = require("child_process").spawn;
var Q = require("q");
/**
* Wrap executing a command in a promise
* @param {string} command command to execute
* @param {Array<string>} args Arguments to the command.
* @param {string} cwd The working directory to run the command in.
* @return {Promise} A promise for the completion of the command.
*/
# Turn a PEG on its head! Generate some compliments.
class Complimenter
def compliments
phrases
end
def phrases
phrase + ". " + maybe { phrases }
end
@sukima
sukima / XORCipher.js
Last active December 21, 2024 03:07
A Super simple encryption cipher using XOR and Base64 in JavaScript
// XORCipher - Super simple encryption using XOR and Base64
//
// Depends on [Underscore](http://underscorejs.org/).
//
// As a warning, this is **not** a secure encryption algorythm. It uses a very
// simplistic keystore and will be easy to crack.
//
// The Base64 algorythm is a modification of the one used in phpjs.org
// * http://phpjs.org/functions/base64_encode/
// * http://phpjs.org/functions/base64_decode/
@quephird
quephird / best-ios-games.txt
Last active December 16, 2015 10:39
This is a top-ten list, in no particular order, of what I believe to be the best games on the iOS platform.
Badland - Platformer/puzzler
Cordy 2 - Platformer
Phoenix HD - Bullet hell shmup
Danmaku Unlimited 2 - Bullet hell shump
DoDonPachi Resurrection - Bullet hell shmup
Plants vs. Zombies - Tower defense
Monster's Inc Run - Platformer
Bad Piggies - Puzzler
Bug Princess 2 - Bullet hell shmup
EDGE EX - Puzzler
@sukima
sukima / foo.sh
Created April 18, 2013 02:43
An example of shell arguments without getopt or getopts
#!/bin/bash
while test $# -gt 0
do
case $1 in
# Normal option processing
-h | --help)
# usage and help
;;
-v | --version)