Skip to content

Instantly share code, notes, and snippets.

@zmughal
Created May 8, 2011 04:01
Show Gist options
  • Save zmughal/961086 to your computer and use it in GitHub Desktop.
Save zmughal/961086 to your computer and use it in GitHub Desktop.
Note to self: more syntax can make things clean
# this
if($data_pos < @data) {
# data on line
$self->window()->addstr($data[$data_pos]);
} else {
# tilde on line
$self->window()->addstr("~");
}
# or this
$self->window()->addstr($data[$data_pos] // "~");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment