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
| #!/bin/bash | |
| (: > .irssi/fnotify ; tail -f .irssi/fnotify | \ | |
| while read heading message; do \ | |
| /usr/local/bin/growlnotify -t "${heading}" -m "${message}"; \ | |
| done) |
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
| # This is the default .slate file. | |
| # If no ~/.slate file exists this is the file that will be used. | |
| config defaultToCurrentScreen true | |
| config windowHintsShowIcons true | |
| config windowHintsIgnoreHiddenWindows false | |
| config windowHintsSpread true | |
| config nudgePercentOf screenSize | |
| config resizePercentOf screenSize | |
| config windowHintsDuration 10000 |
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 f = new Function("x", | |
| "with(Math) {" + | |
| "return " + input.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
| with (Math) { | |
| var x = sin(PI / 2); //1 | |
| } |
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
| scrollId = setInterval(function () { window.scrollBy(0, 5);}, 2); |
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
| @interface MyClass() | |
| // Lazy inits are perfect for readonly values | |
| // Note that strong can be used instead of copy here because | |
| // we control the creation of the array and don't have to worry about | |
| // being passed a mutable version | |
| @property(nonatomic, readonly, strong) NSArray *values; | |
| @end | |
| @implementation MyClass |
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
| #import <Foundation/Foundation.h> | |
| @interface Person | |
| @property(nonatomic, copy) NSString *firstName; | |
| @property(nonatomic, copy) NSString *lastName; | |
| @property(nonatomic, readonly, strong) NSString *fullName | |
| @end |
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
| def hours(open, close) | |
| (0..6).to_a.map do |x| | |
| { | |
| start: x * 24 + open, | |
| end: x * 24 + close | |
| } | |
| end | |
| end | |
| # Could be binary search |
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
| println("Before async") | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) | |
| , { | |
| println("async") | |
| }) | |
| println("After async") |
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
| func _if(condition: BooleanType, action: () -> ()) { | |
| if condition { | |
| action() | |
| } | |
| } | |
| _if(1 < 2) { | |
| println("1 is less than 2") | |
| } |
OlderNewer