This file contains hidden or 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
@echo off | |
TITLE SVN Update | |
D: | |
cd D:\trunk\test | |
svn update | |
pause |
This file contains hidden or 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
@echo off | |
TITLE Uptime | |
For /f "tokens=1,2,3 delims=" %%a in ("%TIME%") do (set mytime=%%a%%b) | |
::('time /t') | |
net stats workstation | find "since" | |
echo Statistics current time is %mytime% | |
:: display 5s then close the window | |
timeout /t 5 /nobreak > NUL |
This file contains hidden or 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
function isVibrationEnabled(){ | |
return (navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate) ; | |
} |
This file contains hidden or 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
var data:NSData! = content.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true) | |
let jsonDict : NSDictionary? = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &error) as? NSDictionary | |
if let err = error { | |
println("error parsing json") | |
} |
This file contains hidden or 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
if let jsonDictionary = jsonDict { | |
println("json parsed successfully") | |
let total = jsonDictionary["centres"]!.count | |
let json_data = JSONValue(jsonDictionary) | |
if json_data{ | |
for var index = 0; index < total; ++index { | |
var name = json_data["centres"][index]["name"].string | |
if name { | |
//processing value | |
} |
This file contains hidden or 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
var error: NSError? | |
let bundle = NSBundle.mainBundle() | |
let path = bundle.pathForResource("data", ofType: "json") | |
let content = NSString.stringWithContentsOfFile(path) as String |
This file contains hidden or 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
"centres":[ | |
{"name":"PCF Centre Block 121","code":...}, | |
{"name":"PCF Centre Block 121","code":...} | |
... | |
] |
NewerOlder