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
<templateSet group="Python"> | |
<template name="ase" value="self.assertEqual($EXPECTED$, $ACTUAL$)" description="Assert Equal" toReformat="false" toShortenFQNames="true"> | |
<variable name="EXPECTED" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="ACTUAL" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="Python" value="true" /> | |
</context> | |
</template> | |
<template name="slow" value="@unittest.skipIf(os.environ.get('FAST'), "Only running fast tests.")" description="Slow test" toReformat="true" toShortenFQNames="true"> | |
<context> |
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
server { | |
listen 80 default_server deferred; | |
listen [::]:80 default_server deferred; | |
server_name _; | |
location ^~ /.well-known/acme-challenge { | |
allow all; | |
# Install https://certbot.eff.org/ | |
# certbot certonly --webroot --email your@email --agree-tos --preferred-challenges http -w /etc/letsencrypt/webroot/ -d your.domain -d your2.domain | |
default_type text/plain; |
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": { |
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
# 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
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
.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
# 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
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
# 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: |