Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kerrishotts
kerrishotts / scroller.js
Created June 8, 2012 22:30
This library is intended to be similar to iScroll-lite in that it should be a relatively fast method of scrolling content without being horribly laggy or cause incorrect "clicks" to be registered.
/******************************************************************************
*
* SCROLLER
* Author: Kerri Shotts
* Version: 0.1 alpha
* License: MIT
*
* This library is intended to be similar to iScroll-lite in that it should be
* a relatively fast method of scrolling content without being horribly laggy
* or cause incorrect "clicks" to be registered.
@kerrishotts
kerrishotts / ui-gestures.js
Created July 20, 2012 08:20
Simple Gesture Recognition
/*jshint asi:true, forin:true, noarg:true, noempty:true, eqeqeq:false, bitwise:true, undef:true, curly:true, browser:true, devel:true, smarttabs:true, maxerr:50 */
/******************************************************************************
*
* UI-GESTURES
* Author: Kerri Shotts
* Version: 0.1 alpha
* License: MIT
*
* A simple, no-frills gesture recognizer. Permits long-press recognition,
* horizontal swipe recognition, and vertical swipe recognition. Recognizing
@kerrishotts
kerrishotts / xhrjson.js
Created July 30, 2012 18:42
My XHR and JSON
PKUTIL.loadQueue = Array();
PKUTIL.XHRinProgress = false;
PKUTIL.XHRTimer = -1;
PKUTIL.load = function(theFileName, aSync, completion)
{
if (device.platform != "WinCE")
{
PKUTIL._load(theFileName, aSync, completion);
return;
@kerrishotts
kerrishotts / fileutil.js
Created August 6, 2012 06:58
HTML5 WC3 FILE API WRAPPER/PG FILE API WRAPPER
/*jshint asi:true, forin:true, noarg:true, noempty:true, eqeqeq:false, bitwise:true, undef:true, curly:true, browser:true, devel:true, smarttabs:true, maxerr:50 */
/******************************************************************************
*
* FILEUTIL
* Author: Kerri Shotts
*
* This library includes routines to deal with the FILE API, (which is... a bit
* painful.) The purpose of the library is to reduce the amount of work necessary
* to go through obtaining a file system, working with directories and files,
* etc. That isn't to say that we can eliminate callbacks or even callback
@kerrishotts
kerrishotts / PKSOAP.js
Last active June 14, 2016 16:15
Simple SOAP library for JavaScript (PhoneGap Compatible), v0.1
/*jshint asi:true, forin:true, noarg:true, noempty:true, eqeqeq:false, bitwise:true, undef:true, curly:true, browser:true, devel:true, smarttabs:true, maxerr:50 */
/******************************************************************************
*
* SOAP
* Author: Kerri Shotts
*
* This library includes simple SOAP functions. MIT license.
*
*
* Usage is pretty straightforward:
@kerrishotts
kerrishotts / easyCreate.shl
Created December 6, 2012 19:42
Sample wrapper around PhoneGap create command
#!/bin/bash
#
# this is a wrapper around PG's ./create command. It asks for
# each portion separately.
#
# Author: Kerri Shotts
# License: MIT
#
# Get the path to the PhoneGap installation
// based on and inspired by https://gist.github.com/1026439 and https://gist.github.com/3798781
//
// MIT license. Use however you'd like.
//
// first, define our macro for delaying our transition:
#define PKWaitDelay(dly, block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW,dly*100000),dispatch_get_current_queue(), ^{ block })
// then, inside your AppDelegate.m in didFinishLaunchingWithOptions:
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.frame];
@kerrishotts
kerrishotts / UIBarButtonItem+Utility.h
Created February 18, 2013 20:13
UIBarButtonItem Utility: Quick & Dirty bar button item creation using Font Awesome, Text Attributes, and Background images.
// Author: Kerri Shotts
// MIT LIcense
#import <UIKit/UIKit.h>
@interface UIBarButtonItem (Utility)
+(UIBarButtonItem *) barButtonItemUsingFontAwesomeIcon: (NSString *)iconKey
target: (id)theTarget
action: (SEL)theAction
@kerrishotts
kerrishotts / gist:5061352
Created March 1, 2013 00:15
Tired of dealing with trying to get bold and/or italicized fonts out of iOS given only the font name? This should help.
// UIFont+Utility.h
// UIFont+Utility.[h|m] is (C) Kerri Shotts 2013, and released under an MIT license.
#import <UIKit/UIKit.h>
/**
*
* PKFontNormal = no modifications to the font; i.e., -Regular, -Roman, -Book, etc.
* PKFontBold = bold font desired (if possible); i.e., -Bold, -Black, -Heavy, etc.
* PKFontItalic = italic font desired (if possible); i.e., -Italic, -Oblique, etc.
@kerrishotts
kerrishotts / FileManager.js
Last active September 21, 2022 10:14
Simple File API wrapper using Q.js. Same code as in http://github.com/photokandyStudios/YASMF-Next/blob/master/lib/yasmf/util/fileManager.js, except wrapped in a global function. The code below will add a FileManager object to `window`, if it is passed in (otherwise it will only return it). It can then be used as seen in this demo: http://jsbin.…
;(
function( Q, BaseObject, globalContext ) {
/**
* Defined by Q, actually, but defined here to make type handling nicer
* @typedef {{}} Promise
*/
var DEBUG = false;
/**
* Requests a quota from the file system
* @method _requestQuota