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 PIL import Image | |
import pdb | |
BANNER_SIZE = (650,400) | |
THUMBNAIL_SIZE = (106,80) | |
TILE_SIZE = (82,61) | |
GIVEN_FILE = "tile123.png" | |
def resize_picture(saved_name, root_image, size): |
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
*.py[cod] | |
# C extensions | |
*.so | |
# Packages | |
*.egg | |
*.egg-info | |
build | |
eggs |
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
# File: multihost.py | |
import time | |
from django.conf import settings | |
from django.utils.cache import patch_vary_headers | |
class MultiHostMiddleware: | |
def process_request(self, request): | |
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 urllib | |
import base64 | |
import httplib | |
import ast | |
import requests | |
CONSUMER_KEY = '' | |
CONSUMER_SECRET = '' | |
def get_access_token(CONSUMER_KEY, CONSUMER_SECRET): |
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
# calling oauth 2 access_token api | |
import requests | |
from requests.auth import HTTPBasicAuth | |
data = {'grant_type':'password','username':'username','password':'password'} | |
auth=HTTPBasicAuth('id', 'secret') | |
aa = requests.post('http://127.0.0.1:8000/o/token/', auth=auth, data=data) |
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
.gradle | |
/local.properties | |
/.idea/workspace.xml | |
/.idea/libraries | |
.DS_Store | |
/build | |
/captures |
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
git+https://github.com/django-nonrel/django.git | |
git+https://github.com/django-nonrel/djangotoolbox.git | |
git+https://github.com/django-nonrel/mongodb-engine.git | |
djangorestframework==2.4.0 | |
djutil==0.2 | |
pymongo==3.2 | |
wheel==0.24.0 |
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
# For dumping the database | |
pg_dump -W -U <username> -h localhost <dbname> > <file_name> | |
# For loading the database | |
psql -W -U <username> -H <db_name> < <file_name> | |
# for uploading a file on server | |
scp -i server.pem <file_name> ubuntu@url:<file_name> | |
# for downloading a file |
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
map $http_user_agent $limit_bots { | |
default 0; | |
~*(google|bing|yandex|msnbot) 1; | |
~*(AltaVista|Googlebot|Slurp|BlackWidow|Bot|ChinaClaw|Custo|DISCo|Download|Demon|eCatch|EirGrabber|EmailSiphon|EmailWolf|SuperHTTP|Surfbot|WebWhacker) 1; | |
~*(Express|WebPictures|ExtractorPro|EyeNetIE|FlashGet|GetRight|GetWeb!|Go!Zilla|Go-Ahead-Got-It|GrabNet|Grafula|HMView|Go!Zilla|Go-Ahead-Got-It) 1; | |
~*(rafula|HMView|HTTrack|Stripper|Sucker|Indy|InterGET|Ninja|JetCar|Spider|larbin|LeechFTP|Downloader|tool|Navroad|NearSite|NetAnts|tAkeOut|WWWOFFLE) 1; | |
~*(GrabNet|NetSpider|Vampire|NetZIP|Octopus|Offline|PageGrabber|Foto|pavuk|pcBrowser|RealDownload|ReGet|SiteSnagger|SmartDownload|SuperBot|WebSpider) 1; | |
~*(Teleport|VoidEYE|Collector|WebAuto|WebCopier|WebFetch|WebGo|WebLeacher|WebReaper|WebSauger|eXtractor|Quester|WebStripper|WebZIP|Wget|Widow|Zeus) 1; | |
~*(Twengabot|htmlparser|libwww|Python|perl|urllib|scan|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1; | |
} |
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
{ | |
"goal_setting": [ | |
{ | |
"items": [ | |
{ | |
"Person": { | |
"action": {}, | |
"data": "Test Gm" | |
}, | |
"50% completion": { |
OlderNewer