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
# -*- encoding: utf-8 -*- | |
from migrate.versioning import api | |
import os.path | |
from my_project_here import db | |
from my_project_here import app | |
SQLALCHEMY_DATABASE_URI = app.config['SQLALCHEMY_DATABASE_URI'] | |
SQLALCHEMY_MIGRATE_REPO = app.config['SQLALCHEMY_MIGRATE_REPO'] | |
db.create_all() |
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 ClassA(object): | |
print("Class A") | |
def __init__(self): | |
print("Instance of A") | |
def test(self): | |
print("Test of A") | |
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 tests import testentities | |
import unittest | |
def suite(): | |
suite = unittest.TestSuite() | |
suite.addTest(testentities.suite()) | |
return suite |
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
# -*- coding utf-8 -*- | |
import pymssql | |
SQL_SERVER = { | |
'server': '127.0.0.1:1433', | |
'user': 'myuser', | |
'password': 'mypass', | |
'database': 'mydatabase', | |
} |
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
# -*- coding: utf-8 -*- | |
import requests | |
headers = { | |
'Content-Type': 'text/xml; charset=utf-8', | |
'SOAPAction': ('http://127.0.0.1/GenericAction'), | |
} | |
url = 'http://127.0.0.1/GenericAction.svc' |
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import | |
import ssl | |
import socket | |
import requests | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.poolmanager import PoolManager | |
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
#!/bin/bash | |
SCRIPT=`basename ${BASH_SOURCE[0]}` | |
NORM=`tput sgr0` | |
BOLD=`tput bold` | |
REV=`tput smso` | |
GODIR="/usr/local/go" | |
GOBINDIR="$GODIR/bin" | |
if [ ! -d $GODIR -o ! -d $GOBINDIR ]; then |
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
# -*- coding: utf-8 -*- | |
# This code is inspired by: | |
# 1. http://docs.celeryproject.org/en/latest/tutorials/task-cookbook.html | |
# 2. http://loose-bits.com/2010/10/distributed-task-locking-in-celery.html | |
from django.core.cache import caches | |
class Locker(object): | |
""" |
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
#!/bin/bash | |
DOCKERIMAGE=$1 | |
if [ -z "$DOCKERIMAGE" ]; then | |
echo 'Paramether $1 not found.' | |
echo "Syntax: $0 DOCKERIMAGE" | |
exit 1 | |
fi | |
docker ps -a | docker ps -a | awk '$2 ~ /'$DOCKERIMAGE'/ { print }' |
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
# -*- coding: utf-8 -*- | |
import json | |
from urllib import urlopen | |
import time | |
DEBUG = True | |
TEMPO = 5 | |
OlderNewer