This file contains hidden or 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
django-startproject.py __project-name__ --extension="py,rst,conf,wsgi" --template=https://github.com/tangentlabs/tangent-django-boilerplate/zipball/master --extra_context='{"client":"__client__", "project_code":"__project-code__", "domain":"__domain__", "timezone":"__timezone__"}' |
This file contains hidden or 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
// http://css-tricks.com/snippets/jquery/find-all-internal-links/ | |
var siteURL = "http://" + top.location.host.toString(); | |
var $internalLinks = $("a[href^='"+siteURL+"'], a[href^='/'], a[href^='./'], a[href^='../'], a[href^='#']"); |
This file contains hidden or 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
// http://css-tricks.com/snippets/jquery/target-only-external-links/ | |
$('a').each(function() { | |
var a = new RegExp('/' + window.location.host + '/'); | |
if (!a.test(this.href)) { | |
// This is an external link | |
} | |
}); |
This file contains hidden or 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
/* | |
Vertical text | |
by @kizmarh | |
*/ | |
.vertical-text { | |
display: inline-block; | |
overflow: hidden; | |
width: 1.5em; | |
} | |
.vertical-text__inner { |
This file contains hidden or 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/sh | |
#Configurations injected by install_server below.... | |
EXEC=/usr/local/bin/redis-server | |
CLIEXEC=/usr/local/bin/redis-cli | |
PIDFILE=/var/run/redis_6379.pid | |
CONF=/etc/redis/6379.conf | |
REDISPORT=6379 | |
REDISSOCKET=/var/run/redis_6379.sock | |
SOCKET_USER=www-data |
This file contains hidden or 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; | |
server_name example.com; | |
charset utf-8; | |
rewrite_log on; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log notice; | |
client_max_body_size 20M; | |
root /usr/share/nginx/www/example.com/public; |
This file contains hidden or 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 | |
PATH_TO_CONFIG='docker-compose.yml' | |
unamestr=$(uname) | |
cmd_prefix='sudo ' | |
if [ "${unamestr}" == "Darwin" ]; then | |
cmd_prefix='' | |
docker-machine ip dev | |
fi |
This file contains hidden or 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 collections import namedtuple | |
from operator import attrgetter | |
from oscar.apps.partner import prices | |
from oscar.apps.partner.strategy import Structured | |
# A container for policies | |
ExtendedPurchaseInfo = namedtuple( | |
'ExtendedPurchaseInfo', ['price', | |
'min_price', |
This file contains hidden or 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|Curl|email|PycURL|Pyth|PyQ|WebCollector|WebCopy|webcraw) 1; | |
} |
This file contains hidden or 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 schematics.undefined import Undefined | |
from schematics.compat import iteritems | |
from schematics.iteration import Atom | |
from schematics.types import IntType, ListType, DictType, ModelType | |
from schematics import Model | |
def old_atoms(schema, mapping, keys=Atom._fields, filter=None): |
OlderNewer