Skip to content

Instantly share code, notes, and snippets.

View djwglpuppy's full-sized avatar

David K Roberts djwglpuppy

  • Apple
  • Cupertino
View GitHub Profile
@djwglpuppy
djwglpuppy / gist:7774068
Created December 3, 2013 17:53
for various export type for JS
// AMD / RequireJS
if (typeof define !== 'undefined' && define.amd) {
define([], function () {
return async;
});
}
// Node.js
else if (typeof module !== 'undefined' && module.exports) {
module.exports = async;
}
class Nando():
def __init__(self):
print "Super Cool!"
AwesomePerson = Nando()
@djwglpuppy
djwglpuppy / steps.md
Created November 4, 2012 21:39
Steps to Try

Steps to Make Sure Device Works

Sorry for the inconvenience.... but this may get you back and situated with Testflight on your device

  • Remove TestFlight Webclip from window
  • Go To Settings > General > Profiles
  • Remove the TestFlight WebClip
  • Go to Settings > Safari
    • Make Sure Private Browsing is Turned Off
  • Clear Cookies and Data
@djwglpuppy
djwglpuppy / gist:3874736
Created October 11, 2012 19:00
touchend event
isMobile = function() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
};
jQuery.fn.touchend = function(cb) {
return _.each(this, function(item) {
var isvalidend, newcb, touchevent, validend;
if (isMobile()) {
isvalidend = true;
validend = null;
@djwglpuppy
djwglpuppy / gist:3277947
Created August 6, 2012 19:49
command shell commands

Grab the ErrorType and Sort from an errors output

nl errors.txt | grep -E '\d+\s?\w+Error' | sort -k2

Grab the latest numeric increment from a tag (change the substr value)

git tag | grep victoryhawk | awk '{print substr($1,12); }' | sort -n | tail -1
@djwglpuppy
djwglpuppy / gist:3145195
Created July 19, 2012 16:43
Setting up Shared Folders for Virtual Box in Ubuntu 12.04

#Setting up Ubuntu 12.04 for File Sharing

SSH into the Ubuntu Virtual Machine and run these commands

ubuntu> sudo apt-get install build-essential module-assistant
ubuntu> sudo m-a prepare

From the VirtualBox menu in OSX Devices > Install Guest Additions…

@djwglpuppy
djwglpuppy / gist:2410369
Created April 18, 2012 01:29
You were right :)
test = {3: "A", 1: "B", 2: "C"}
# output
# {1: 'B', 2: 'C', 3: 'A'}
@djwglpuppy
djwglpuppy / gist:2253849
Created March 30, 2012 18:39
Possible Answer Format
{
email: "[email protected]"
questions: [
{
id: 25
answer: 345
},
{
id: 25
suboptions: [