Skip to content

Instantly share code, notes, and snippets.

@zaersk
zaersk / main.m
Last active March 29, 2016 06:32
Attempt to login to Instagram using their unofficial API (no OAuth tokens).
//
// main.m
// ER1
//
// Created by @zaersk_ on 7/19/14.
// Copyright (c) 2014 Zaersk. All rights reserved.
//
// Attempt to login to Instagram using their unofficial API (no OAuth tokens).
#import <Foundation/Foundation.h>
@zaersk
zaersk / stocks.m
Last active August 29, 2015 14:04
BM
NSString *textString = @"APPL";
NSString *query = [NSString stringWithFormat:@"select * from yahoo.finance.quotes where symbol in (\"%@\")", textString];
NSString *escapedStoreUrl = [@"store://datatables.org/alltableswithkeys" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
NSString *escapedQuery = [query stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]];
NSString *urlString = [NSString stringWithFormat:@"http://query.yahooapis.com/v1/public/yql?q=%@&env=%@&format=json", escapedQuery, escapedStoreUrl];
NSMutableURLRequest *mutableRequestGET = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]];
[mutableRequestGET setHTTPMethod:@"GET"];
NSData *dataResponse = [NSURLConnection sendSynchronousRequest:mutableRequestGET returningResponse:nil error:nil];
@zaersk
zaersk / gist:649375cc767b017640a3
Last active August 29, 2015 14:04
Instagram Bolt Endpoints (WIP)
Instagram Bolt (“Pepper”) Endpoints
WIP by @zaersk_ 07/29/2014
Messages:
http://pepper.instagram.com/messages/
http://pepper.instagram.com/messages/<postId>/reply/
http://pepper.instagram.com/messages/<postId>/seen/
http://pepper.instagram.com/messages/<postId>/undo/
func ζ(s:Int) -> Double {
var i : Double = Double()
var sum : Double = Double()
for (var i = 1.0; i < Double.infinity; i++) {
sum += (1 / pow(i, Double(s)))
}
return sum
}
func ackermann(m:Int, n:Int) -> Int {
if (m == 0) {
return n + 1
} else if (n == 0) {
return ackermann(m-1, 1)
} else {
return ackermann(m-1,ackermann(m, n-1))
}
}