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
function errexit() { | |
local err=$? | |
set +o xtrace | |
local code="${1:-1}" | |
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
# Print out the stack trace described by $function_stack | |
if [ ${#FUNCNAME[@]} -gt 2 ] | |
then | |
echo "Call tree:" | |
for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
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 sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |