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
### Keybase proof | |
I hereby claim: | |
* I am shaunxw on github. | |
* I am shaunw (https://keybase.io/shaunw) on keybase. | |
* I have a public key ASBgaQM519wS4wN0Vls6AlDKSqq0pcPfJMG0i-9eSHq8Vgo | |
To claim this, I am signing this object: |
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
#[derive(Debug)] | |
struct S(u32); | |
fn move_struct() -> S { | |
let s = S(0); | |
println!("addr before move: {:p}", &s); | |
s | |
} | |
fn move_box() -> Box<S> { |
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
# Mouse | |
set -g mouse on | |
set -g set-clipboard external | |
# Pane splitting. | |
bind h split-window -c "#{pane_current_path}" -h | |
bind v split-window -c "#{pane_current_path}" -v | |
# Autorename sanely. | |
setw -g automatic-rename on |
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
import functools | |
# `_func` should not be used as kwarg here, as it is for detecting if | |
# this decorator is used with parentheses or not. | |
def my_dec(_func=None, *, my_kwarg="my keyword arg"): | |
""" | |
Could used with parentheses or not. | |
""" | |
def decorator(func): |
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
import UIKit | |
// UIFont | |
// create a font by name and size | |
let avenirFont = UIFont(name: "Avenir", size: 12) | |
// get a font with different size from another font | |
let avenirLargeFont = avenirFont?.withSize(30) |