> g t
git: 't' is not a git command. See 'git --help'.
Did you mean one of these?
tag
a
b
c
d
e
> g t
git: 't' is not a git command. See 'git --help'.
Did you mean one of these?
tag
a
b
c
d
e
| <?xml version="1.0"?> | |
| <root> | |
| <item> | |
| <name>F19 → Backspace/Hyper</name> | |
| <identifier>narfdotpl.hyper</identifier> | |
| <autogen> | |
| __KeyOverlaidModifier__ | |
| KeyCode::F19, |
| $ python2.7 | |
| Python 2.7.2 (default, Oct 17 2011, 00:04:42) | |
| [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> result = None | |
| >>> for n in range(1000): | |
| ... m = int(str(n)) | |
| ... previous_result = result | |
| ... result = n is m | |
| ... if result != previous_result: |
| Python 2.7.2 (default, Oct 17 2011, 00:04:42) | |
| [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> from dis import dis | |
| >>> def short(xs): | |
| ... xs[0] += 1 | |
| ... | |
| >>> dis(short) | |
| 2 0 LOAD_FAST 0 (xs) | |
| 3 LOAD_CONST 1 (0) |
| class Counter { | |
| let inc: () -> Int | |
| let dec: () -> Int | |
| init(start: Int) { | |
| var n = start | |
| inc = { ++n } | |
| dec = { --n } | |
| } |
println("\"Normal\" code.")| let email = "hello@narf.pl" | |
| let domain = email[find(email, "@")!.succ()..email.endIndex] // WTF | |
| println(domain) |
| def f(s): | |
| return '%.3f' % (int(s, 16) / 255.0) | |
| def rgb(s): | |
| print '[UIColor colorWithRed:%s green:%s blue:%s alpha:1],' % \ | |
| tuple(f(s.lstrip('#')[i : i + 2]) for i in range(0, 6, 2)) | |
| rgb('ffffff') # [UIColor colorWithRed:1.000 green:1.000 blue:1.000 alpha:1], | |
| rgb('ff0000') # [UIColor colorWithRed:1.000 green:0.000 blue:0.000 alpha:1], |
https://twitter.com/narfdotpl/status/558348210079809536
extension Dictionary {
func map(f: (Hmm.Key, Hmm.Value) -> (A, B)) -> [A: B] {| // Of course, `if let` with multiple optionals is lazy. | |
| // | |
| // Tested on 2015-02-09 in Xcode 6.3 Beta 1, Swift 1.2. | |
| func foo() -> Int? { | |
| println("foo") | |
| return 0 | |
| } |