Skip to content

Instantly share code, notes, and snippets.

View Gurpartap's full-sized avatar
:octocat:
Working from home

Gurpartap Singh Gurpartap

:octocat:
Working from home
View GitHub Profile
@Gurpartap
Gurpartap / Godfather_.swift
Last active September 15, 2015 07:48 — forked from ivangodfather/gist:9f3ad527198ee513308e
For @Godfather_ on IRC
request(.GET, CUSTOMER_URL, parameters: params, encoding: .URL).responseJSON { (request, response, result) -> Void in
if let message = JSON(result.value ?? "")["message"].string ?? "Default value to make it nonOptional" {
switch(result) {
case .Success(let json):
if let customer = JSON(json)["customer"].dictionaryObject {
GlobalCache.sharedInstance.setCustomer(customer)
}
completion(succeed: response?.statusCode == 200, message: message)
case .Failure(_,_):
completion(succeed: false, message: message)
@Gurpartap
Gurpartap / gist:1423205
Created December 2, 2011 13:14 — forked from odrobnik/gist:1423199
Uploading documentation to GitHub
mkdir gh-pages
cd gh-pages
git init
git remote add origin git@github.com:Cocoanetics/DTWebArchive.git
# add and commit files
git push origin master:gh-pages