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
class Shared { | |
static var data: Int! | |
} |
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 tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
let data = tableData[indexPath.row] | |
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) | |
let destVC = storyboard.instantiateViewControllerWithIdentifier("goToHere") as! DestVC | |
destVC.data = data | |
navigationController?.pushViewController(destVC, animated: true) | |
} |
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
class destinationVC: UIViewController { | |
var dataFromAnotherVC: String! | |
override func viewWillAppear(animated: Bool) { | |
// can use dataFromAnotherVC here | |
} | |
// rest of the class |
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 tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
performSegueWithIdentifier(“mySegueName”, sender: "hello!") | |
} | |
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
if let vc = segue.destinationViewController as? DestVC { | |
vc.dataFromAnotherVC 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
require('http').Server(function (req, res) {}) | |
.listen(28423, '127.0.0.1', function () { | |
var request = require('request') | |
request({ | |
"method": "GET", | |
"uri": "http://127.0.0.1:28423", | |
"timeout": 1000 | |
}).on('error', function(e){ | |
console.log('error') |
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
➜ ~ brew --config | |
HOMEBREW_VERSION: 0.9.4 | |
ORIGIN: https://github.com/mxcl/homebrew | |
HEAD: bf31154f700a73c5c14b96edf447e75964e9390d | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: 8-core 64-bit ivybridge | |
OS X: 10.8.3-x86_64 | |
Xcode: 4.6.1 | |
CLT: 4.6.0.0.1.1362189000 |
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
var oldDate = Date; | |
Date = function () { | |
var args = arguments.length > 0 ? Array.prototype.slice.call(arguments) : [1293861600]; | |
if (typeof args[0] === 'string') { | |
args = ["'" + args[0] + "'"]; | |
} | |
return new Function('return new oldDate(' + args.join(',') + ');')(); | |
} |
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
var dgram = require('dgram'); // dgram is UDP | |
// Listen for responses | |
function listen(port) { | |
var server = dgram.createSocket("udp4"); | |
server.on("message", function (msg, rinfo) { | |
console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port); | |
}); |
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
description "redis server" | |
start on runlevel [2345] | |
stop on shutdown | |
exec /usr/local/bin/redis-server /etc/redis/redis.conf | |
respawn |
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
formaline, event "message" --> {"type":"warning","isupload":true,"msg":"unable to retrieve session identifier, configuration parameter me.getSessionID must be a function!"} | |
formaline, HTTP Request Headers : { | |
"host": "domain.com", | |
"user-agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0) Gecko/20100101 Firefox/7.0", | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | |
"accept-language": "en-us,en;q=0.5", | |
"accept-encoding": "gzip, deflate", | |
"accept-charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", | |
"connection": "keep-alive", | |
"referer": "http://domain.com/test.html", |