This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version":"0.0.2", | |
"bio":{ | |
"firstName":"Joseph", | |
"lastName":"Neuman", | |
"email":{ | |
"work":"joe@gotappsusa.com" | |
}, | |
"summary":"Long live Octo-StrongBad", | |
"location":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef NS_ENUM(NSInteger, NetworkStatus) { | |
NotReachable = 0, | |
ReachableViaWiFi, | |
ReachableViaWWAN | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func md5() -> String! { | |
let str = self.cStringUsingEncoding(NSUTF8StringEncoding) | |
let strLen = CUnsignedInt(self.lengthOfBytesUsingEncoding(NSUTF8StringEncoding)) | |
let digestLen = Int(CC_MD5_DIGEST_LENGTH) | |
let result = UnsafeMutablePointer<CUnsignedChar>.alloc(digestLen) | |
CC_MD5(str!, strLen, result) | |
var hash = NSMutableString() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --soft HEAD~1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func dprintln<T>(object: T, function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, column: Int = __COLUMN__) { | |
println("<\(file.lastPathComponent):(\(line))> \(object)") | |
} | |
func dfprintln<T>(object: T, function: String = __FUNCTION__, file: String = __FILE__, line: Int = __LINE__, column: Int = __COLUMN__) { | |
println("<\(file.lastPathComponent):\(function):(\(line))> \(object)") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Joseph Neuman | |
import Foundation | |
func getBool(object:AnyObject?) -> Bool? { | |
return object as AnyObject? as? Bool | |
} | |
func getDate(object:AnyObject?) -> NSDate? { | |
if let tempObject = object as AnyObject? as? String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latest node.js & npm installation on Ubuntu 12.04 | |
Home / Tutorials / node.js / Latest node.js & npm installation on Ubuntu 12.04 | |
Compiling is way to go for many but I am mostly in hurry so following works for me! | |
Adding Chris Lea’s Repo | |
Using Launchpad repo by Chris Lea just run following commands | |
apt-get install python-software-properties | |
apt-add-repository ppa:chris-lea/node.js | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch | |
http://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func getBool(object:AnyObject?) -> Bool? { | |
if let temp = object as? Bool { | |
return temp | |
} else if let temp = object as? NSNumber { | |
return temp.boolValue | |
} else if let temp = object as? Int { | |
return Bool(temp) | |
} else if let temp = object as? String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
init: function(elevators, floors) { | |
var getByFloor = function (value) { | |
var result = floorsWaiting.filter(function(o){return o.floorNum == value;} ); | |
return result? result[0] : null; // or undefined | |
} | |
var getElevatorById = function (arr, value) { | |
var result = arr.filter(function(o){return o.iden == value;} ); | |
return result? result[0] : null; // or undefined | |
} |
OlderNewer