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
➜ lcthw make all | |
cc -Wall -g ex1.c -o ex1 | |
cc -Wall -g ex3.c -o ex3 | |
cc -Wall -g ex4.c -o ex4 | |
ex4.c:9:17: warning: more '%' conversions than data arguments [-Wformat] | |
printf("I am %d years old.\n"); | |
~^ | |
ex4.c:10:17: warning: more '%' conversions than data arguments [-Wformat] | |
printf("I am %d inches tall.\n"); | |
~^ |
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 replicaSet = { | |
"collection" : "express_sessions", | |
"stringify": false, | |
"db": { | |
"name" : "sessions", | |
"replicaSetOptions": { | |
rs_name: 'default', | |
w: 2 | |
}, | |
"servers" : [ |
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
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
PROMPT='%{$fg[blue]%}%n@%m ${ret_status}%{$fg_bold[green]%}%p%{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
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); | |
}); |