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 | |
import sublime_plugin | |
class SublimeBlockCursor(sublime_plugin.EventListener): | |
def view_is_widget(view): | |
settings = view.settings() | |
return bool(settings.get('is_widget')) | |
def show_block_cursor(self, view): | |
validRegions = [] |
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
<snippet> | |
<content><![CDATA[ | |
myname = inspect.currentframe().f_code.co_name | |
]]></content> | |
<tabTrigger>curprocname</tabTrigger> | |
<scope>source.python</scope> | |
<description>Name of current procedure</description> | |
</snippet> |
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 os | |
import sys | |
def main(): | |
if len(sys.argv) < 2: | |
sys.stderr.write("usage: scriptname source_dir") | |
sys.exit(1) | |
source_dir = sys.argv[1] | |
try: |
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 os | |
# Assign your top level directory to home | |
home = "/Users/rhancock" | |
for dirpath, dirs, files in os.walk(home, topdown=True): | |
for dr in dirs: | |
fullpath_d = os.path.join(dirpath, dr) | |
for fname in os.listdir(fullpath_d): |
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
<snippet> | |
<content><![CDATA[ | |
""" | |
Module: $1 | |
Description: $2 | |
Minimum Python Required: $3 | |
Changelog: |
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
<snippet> | |
<content><![CDATA[ | |
""" | |
${1:Description of why the classes and functions in this file are bundled together.} | |
""" | |
__author__ = "$2" | |
]]></content> |
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
<snippet> | |
<content><![CDATA[ | |
Class $1(object): | |
""" ${2:A comprehensible explanation of the purpose of the class | |
that a non-programmer can understand along with advice on sub-classing.""} | |
Attributes: | |
${3/, ?/:\n\t/g}: | |
""" | |
def __init__(self, $3): |
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
<snippet> | |
<content><![CDATA[ | |
def $1($2): | |
""" ${3:Description} | |
Args: | |
${2/, ?/:\n\t/g}: | |
Returns: | |
$4 |
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
""" | |
Injection of optimzation data into Packrat via the REST API. | |
https://corpwiki.appnexus.com/display/adserver/Packrat | |
""" | |
__author__ = "Bob Hancock (rhancock@appnexus.com)" | |
if __name__ == "__main__": | |
main() |
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 logging | |
def setup_log_size_rotating(log_filename, | |
logname='defaultlog', | |
max_size_in_bytes=(1024 * 1000000), | |
debug=False, | |
backups = 32): | |
""" The file will rollover when it approaches maxBytes. | |
Our default size is 1MB | |
""" |