Skip to content

Instantly share code, notes, and snippets.

View sneakyness's full-sized avatar
💭
Rolling up to the function like a stretched out Steve Ballmer

Nick Pannuto sneakyness

💭
Rolling up to the function like a stretched out Steve Ballmer
View GitHub Profile
/*
keepaway: a silly plugin that makes elements run from the mouse
by sneakyness.
options:
jump: the distance to jump away from the mouse, in pixels; default 500
speed: the speed to move (passed intact to the animate plugin); default ÔfastÕ
home: time to return to the starting position if nothing happens, in ms; default 1000
@bsneed
bsneed / NSObject-extension.m
Created August 3, 2010 23:15
performSelector reimplementation with variable number of params/types and return type.
/*
You can use this to call deprecated methods without warnings (supporting old sdk's for example)
or, you can use it in place of performSelector: where you need non-object params, or multiple
params.
ie: ...
int result = 0;
int index = 12;
NSArray *array = myArray;
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@cowboy
cowboy / ba-detach.js
Created April 23, 2011 16:43
JavaScript detach: detach a node from the DOM, optionally reattaching it when done.
/*!
* JavaScript detach - v0.2 - 5/18/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
function detach(node, async, fn) {
@billylindeman
billylindeman / TextureAtlas.java
Created June 24, 2011 18:24
This is a TextureAtlas class for AndEngine that will load in a Zwoptex Generic plist file (requires android-plist-parser)
//TextureAtlas for andengine
// Billy Lindeman (billy@zoa.io)
// 2011 Protozoa, LLC
//loads texture atlas from Zwoptex Generic plist file
//you pass it the name of the asset (without extension)
//it will load .plist as the coordinates and .png as the texture
//requires https://github.com/tenaciousRas/android-plist-parser
package org.anddev.andengine.opengl.texture.atlas;
@billylindeman
billylindeman / pltojs.py
Created June 24, 2011 21:08
plist to json converter
#!/usr/bin/env python
import plistlib
import json
import sys
def main():
if (len(sys.argv) < 2):
print str(sys.argv[0] + " <plist file>")
sys.exit(1)
@jamiew
jamiew / google_twunter_lol
Created July 28, 2011 20:34
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
@bytespider
bytespider / boilerplate.js
Created September 1, 2011 16:41
jsOAuth xAuth boilerplate
var oauth = OAuth({
consumerKey: 'MY-CONSUMER-KEY',
consumerSecret: 'MY-CONSUMER-SECRET'
});
oauth.post('https://api.twitter.com/oauth/access_token', {
'x_auth_username': 'DarthVader',
'x_auth_password': 'Luk3i5myS0n',
'x_auth_mode': 'client_auth'
}, successCallback, failureCallback);
@numo16
numo16 / Macros.h
Created August 20, 2012 20:38
Some useful iOS/Objective-C Macros
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])
#define UserDefaults [NSUserDefaults standardUserDefaults]
#define NotificationCenter [NSNotificationCenter defaultCenter]
#define SharedApplication [UIApplication sharedApplication]
#define Bundle [NSBundle mainBundle]
#define MainScreen [UIScreen mainScreen]
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x
#define NavBar self.navigationController.navigationBar
@Gi-lo
Gi-lo / gist:4279932
Created December 13, 2012 21:11
Easily create GET NSURLs in Objective-C. (Used in https://github.com/Gi-lo/GCXHTTPOperation )
- (NSURL *)URLWithString:(NSString *)string andQueryValuesForKeys:(NSString *)value, ... {
if (!value) {
return [NSURL URLWithString:string];
}
NSMutableString *queryString = [NSMutableString string];
NSString *argument = nil;
NSUInteger argumentCount = 0;
va_list argumentList;