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
docker ps -a | grep Exit | awk '{print $1}' |xargs docker rm |
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
class AccountForm(forms.ModelForm): | |
class Meta: | |
model = Account | |
fields = ['first_name', 'last_name', 'email', 'password'] | |
def __init__(self, *args, **kwargs): | |
self.university = kwargs.pop('university') | |
self.high_school = kwargs.pop('high_school') | |
self.department = kwargs.pop('department') | |
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
class CreatePaymentTest(TestCase): | |
def setUp(self): | |
self.user = UserFactory() | |
self.payment = PaymentFactory() | |
self.product = ProductFactory() | |
self.url = reverse('api:create-payment') | |
self.headers = get_auth_header(self.user) | |
def test_post_new(self): |
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
"Proof connection at pyodbc level." | |
# Test pyodbc connection. Result is 42. | |
# Note parameters in connection string, <PARAMETER>. | |
import pyodbc | |
conn = pyodbc.connect('DRIVER=FreeTDS;SERVER=<IP_OR_HOSTNAME>;PORT=1433;DATABASE=<DATABASE_NAME>;UID=<USERNAME>;PWD=<PASSWORD>;TDS_Version=8.0;') | |
cursor = conn.cursor() | |
for row in cursor.execute('select 6 * 7 as [Result];'): |
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
"""Podcast Feed Generator | |
Generate an podcast RSS feed for a set of media in a directory. | |
Use the list-extensions argument to see the list of supported extensions. You can add custom extensions using | |
Usage: | |
podcastgen.py gen <directory> --title=<podcast-title> --link=<podcast-link> --desc=<description> [--output=<rss-feed-file>] [--feed-link=<feed-url>] [--id=<podcast-id>] [--logo=<image_file>] [--category=<itunes-category> [--subcategory=<itunes-category>]] [--language=<language>] [--use-extension=<ext>] | |
podcastgen.py list-categories | |
podcastgen.py list-extensions | |
podcastgen.py -h | --help |