Skip to content

Instantly share code, notes, and snippets.

View hellyeah's full-sized avatar

David Fontenot hellyeah

View GitHub Profile
// AFNetworking
[[AFHTTPSessionManager manager] GET:@"http://httpbin.org/ip" parameters:nil success:^(NSURLSessionDataTask *task, id JSON) {
NSLog(@"IP Address: %@", JSON[@"origin"]);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Error: %@", error);
}];
// NSURLSession
NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/ip"];

Git Cheat Sheet

Commands

Getting Started

git init

or

@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
import requests
sites = get_sites_from_db()
for s in sites:
try:
r = requests.head(s)
if r.status_code in [404,500]:
remove_site_from_db(s)
except Exception:
anonymous
anonymous / cristina-fernandez-kirchner-tweets.md
Created July 3, 2013 11:13
President Cristina Fernandez de Kirchner's tweets translation about Evo Morales issue

This is an extraction from http://www.mail-archive.com/kragen-journal@canonical.org/msg00111.html

Edward Snowden is apparently still in Moscow, but Evo Morales's plane leaving Moscow was denied passage over France, Portugal, and apparently Italy, on suspicion that it contained Snowden. (This is how European countries show their gratitude for leaks showing the extent of USG spying on it?) It was forced to land in Vienna, where I'm still not clear on whether it was searched.

President Cristina Fernandez de Kirchner posted an outraged, and