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 | |
import re | |
import json | |
from xml.dom.minidom import * | |
from os.path import basename | |
from copy import copy | |
from xml.sax.saxutils import escape, unescape | |
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
var d = document.createElement('div'); | |
d.innerHTML = '\ | |
<style>\ | |
*:not(.icon):not(i), *:not(.icon):not(i):after, *:not(.icon):not(i):before {\ | |
box-shadow: none !important;\ | |
text-shadow: none !important;\ | |
background-image: none !important;\ | |
border-radius: 0 !important;\ | |
}\ | |
*:not(.icon):not(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
Show hidden characters
[ | |
// Change the syntax of the current file to YAML | |
{ "keys": ["ctrl+alt+y"], "command": "change_syntax", "args": {"syntax": "Packages/YAML/YAML.tmLanguage"}} | |
] |
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
[ | |
// Reload currently active view key shortcut. | |
{ "keys": ["ctrl+alt+o"], "command": "reload_view"} | |
] |
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 tempfile | |
file_descriptor, file_path = tempfile.mkstemp(suffix='.tmp') | |
# You can convert the low level file_descriptor to a normal open file using fdopen | |
with os.fdopen(file_descriptor, 'w') as open_file: | |
open_file.write('hello') |
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
[ | |
// Goto Symbol | |
{ "keys": ["ctrl+alt+r"], "command": "goto_symbol_in_index"} | |
] |
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 firebirdsql | |
conn = firebirdsql.connect( | |
dsn='localhost/3050:PATH_TO_DB.fdb', | |
user='sysdba', | |
password='masterkey' | |
) | |
cur = conn.cursor() | |
# Get all rows from a table |
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
from django.contrib import admin | |
from django.db.models import get_models, get_app | |
from models import BaseModel | |
app = get_app('app_name') | |
for model in get_models(app): | |
if issubclass(model, BaseModel): | |
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 datetime | |
# Time is Central! | |
d = datetime.datetime(2012, 9, 26, 14, 00) | |
# So we can convert our times to Pacific time | |
dt = datetime.timedelta(hours=2) |
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
1. Delete DB | |
2. Create DB | |
3. Remove south from INSTALLED_APPS | |
4. syncdb | |
5. Insert south into INSTALLED_APPS | |
6. sycndb | |
7. migrate --fake | |
8. YAY! |
NewerOlder