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
@mayoff
mayoff / makeAnimatedGif.m
Created February 16, 2013 23:00
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
@danzeeeman
danzeeeman / vine-notes.md
Last active December 12, 2015 03:08
My notes on Vine

##My Notes on Vine

Vine is an iOS only application that lets you shoot, edit, and upload a short 6 second clip. You can search twitter to find vines using the twitter api:search 'http://search.twitter.com/search.json?q=vine&since_id=MAX_ID' you'll get something like this (but with 15 results):

{
	   "completed_in" : 0.0110,
	   "max_id" : 2.982193446625239e+17,
	   "max_id_str" : "298219344662523904",
	   "next_page" : "?page=2&max_id=298219344662523904&q=vine",

"page" : 1,

@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;
@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
@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);
@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,
@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)
@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;
@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) {
@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.