This file contains hidden or 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
// Modified from code found in the following stackoverflow answer: | |
// http://stackoverflow.com/questions/14172455/get-name-and-line-of-calling-function-in-node-js | |
Object.defineProperty(global, '__stack', { | |
get: function(){ | |
var orig = Error.prepareStackTrace; | |
Error.prepareStackTrace = function(_, stack){ return stack; }; | |
var err = new Error; | |
Error.captureStackTrace(err, arguments.callee); | |
var stack = err.stack; |
This file contains hidden or 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 os | |
import sys | |
sys.path += [os.path.join( | |
os.path.dirname( | |
os.path.abspath(__file__)), 'lib')] | |
# Pythonista Modules | |
import console | |
from scene import * |
This file contains hidden or 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 os | |
import sys | |
import pickle | |
import console | |
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder | |
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')] | |
import dropboxlogin # this code can be found here https://gist.github.com/4034526 | |
STATE_FILE = '.dropbox_state' |
This file contains hidden or 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 editor | |
selection = editor.get_line_selection() | |
editor.replace_text(selection[0], selection[1], '') | |
This file contains hidden or 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 editor | |
text = editor.get_text() | |
selection = editor.get_line_selection() | |
selected_text = text[selection[0]:selection[1]] | |
editor.set_selection(selection[0], selection[0] + len(selected_text) - 1) |
NewerOlder