Skip to content

Instantly share code, notes, and snippets.

View joshpuckett's full-sized avatar

Josh Puckett joshpuckett

View GitHub Profile
@joshpuckett
joshpuckett / spinner.js
Created October 21, 2015 00:20
Circular Spinner
spinner = new Layer
width: 100
height: 100
x: 100
y: 100
backgroundColor: "transparent"
spinner.html = "<svg><path fill='#27AE60' d='M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50'></path></svg>"
spinner.animate
properties: {rotation: 360*10}
-(void)getRequest
{
NSURL *url = [NSURL URLWithString:@"https://www.goodreads.com/search.xml?key=O719PsMfvl9e19FFt8LmEg&q=common+sense+mutual+funds"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"GET"];
[request setValue:@"application/xml" forHTTPHeaderField:@"accept"];
[request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
(void)[NSURLConnection connectionWithRequest:request delegate:self];
}
@joshpuckett
joshpuckett / swipeangle.js
Created February 25, 2014 19:42
Swipe Angle
view.on("touchstart", function(e) {
var touch = event.touches[0]
//Grab the initial touch coordinates
xInit = touch.pageX
yInit = touch.pageY
})
view.on("touchmove", function(e) {
var touch = event.touches[0]
xCurrent = touch.pageX