Skip to content

Instantly share code, notes, and snippets.

View nategood's full-sized avatar

Nate Good nategood

View GitHub Profile
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@bgreenlee
bgreenlee / strip_trailing_whitespace.py
Created July 19, 2011 00:27
Sublime Text 2 plugin to strip trailing whitespace #python #sublimetext
import sublime_plugin
class StripTrailingWhitespaceCommand(sublime_plugin.TextCommand):
"""
Strip whitespace from the end of each line in the file.
"""
def run(self, edit):
trailing_white_space = self.view.find_all("[\t ]+$")
trailing_white_space.reverse()
for r in trailing_white_space: