Ctrl+KB | toggle side bar |
Ctrl+Shift+P | command prompt |
Ctrl+` | python console |
Ctrl+N | new file |
Ctrl+L | select line (repeat select next lines) |
import configparser | |
import datetime | |
import json | |
import os | |
import subprocess | |
from pathlib import Path | |
import zoneinfo | |
# Define AWS credentials file path |
#!/usr/bin/env python | |
import sys | |
import subprocess | |
REMOTE_WORK_PREFIX = 'awesomecompany' | |
EMAIL_WORK_PREFIX = 'awesomecompany.com' | |
def git(args, split_lines=False, strip=True): |
#!/usr/bin/env python | |
import sys | |
import subprocess | |
REMOTE_WORK_PREFIX = 'awesomecompany' | |
EMAIL_WORK_PREFIX = 'awesomecompany.com' | |
def git(args, split_lines=False, strip=True): |
import os | |
import glob | |
from django.conf import settings | |
def remove_south_migrations(): | |
for root, dirs, files in os.walk(os.path.join(settings.ABSOLUTE_PATH, "..")): | |
for dir in dirs: | |
if dir == 'migrations': | |
to_delete = set(glob.glob("%s/*.py" % os.path.join(root, dir))) - set(glob.glob("%s/__init__.py" % os.path.join(root, dir))) | |
for f in to_delete: |
import unittest | |
import random | |
def rand5(): | |
return random.randint(1,5) | |
def rand7(): | |
result = 0 | |
while True: | |
result = 5 * (rand5() - 1) + rand5() |
#!/bin/sh | |
SCRIPT="#!/bin/sh | |
if [ \${1} == \"--help\" ]; then | |
/opt/sublime_text/sublime_text --help | |
else | |
/opt/sublime_text/sublime_text | |
fi | |
" | |
from django import forms | |
from django.core.exceptions import ValidationError | |
class EmptyChoiceField(forms.ChoiceField): | |
def __init__(self, choices=(), empty_label=None, required=True, widget=None, label=None, | |
initial=None, help_text=None, *args, **kwargs): | |
if required and empty_label is not None: | |
choices = tuple([(0, empty_label)] + list(choices)) | |
super(EmptyChoiceField, self).__init__(choices=choices, required=required, widget=widget, label=label, |