Instantly share code, notes, and snippets.

View terminal_width.py
#!/usr/bin/env python
import subprocess
command = ['tput', 'cols']
def get_terminal_width():
try:
width = int(subprocess.check_output(command))
View script_starter.py
#!/usr/bin/env python
def main():
# Make list of command line arguments, omitting the script itself.
args = sys.argv[1:]
if not args:
print "usage: "
sys.exit(1)
View truthy.md

true and false vs. "truthy" and "falsey" (or "falsy")

by Jesse Farmer

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False.

But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.). So someone designing a language has to decide what values count as "true" and what count as "false." A non-boolean value that counts as true is called "truthy," and a non-boolean value that counts as false is called "falsey."

View etc: Juicy Color Hex Codes
---
- Background:
- 222222
Foreground:
- e3e2e0
Teal:
- 3bc7b8
Yellow:
- f9d423
Red:
View linux: Unity Launcher Template
[Desktop Entry]
Version=1.0
Name=
GenericName=
Exec=
Terminal=false
Icon=
Type=Application
Categories=