Skip to content

Instantly share code, notes, and snippets.

Brandon Rubin Steelsouls

Block or report user

Report or block Steelsouls

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Steelsouls
Steelsouls / script_starter.py
Created Jan 30, 2014
Python: Template Command-Line Script
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)
@Steelsouls
Steelsouls / terminal_width.py
Last active Aug 29, 2015
Function to return width of terminal running the script. Perfect for CLI apps in determining available space for formatting output data. If run as a script simply prints the number.
View terminal_width.py
#!/usr/bin/env python
import subprocess
command = ['tput', 'cols']
def get_terminal_width():
try:
width = int(subprocess.check_output(command))
@Steelsouls
Steelsouls / linux: Unity Launcher Template
Last active Dec 17, 2015
Unity Launcher Template (save-to: /usr/share/applications/app-name.desktop)
View linux: Unity Launcher Template
[Desktop Entry]
Version=1.0
Name=
GenericName=
Exec=
Terminal=false
Icon=
Type=Application
Categories=
@Steelsouls
Steelsouls / etc: Juicy Color Hex Codes
Created May 30, 2013
Color codes for my favorite scheme - Juicy from Dayle Rees Schemes Sublime Text Package
View etc: Juicy Color Hex Codes
---
- Background:
- 222222
Foreground:
- e3e2e0
Teal:
- 3bc7b8
Yellow:
- f9d423
Red:
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."

You can’t perform that action at this time.