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
import tweepy | |
import tempfile | |
import urllib | |
from time import sleep | |
import os | |
url = 'http://wwc.instacam.com/instacamimg/KDCA/KDCA_l.jpg' | |
# The consumer keys can be found on your application's Details | |
# page located at https://dev.twitter.com/apps (under "OAuth settings") |
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
Show hidden characters
{ | |
"cmd": ["curl","-s","-S","--write-out", "Response code: %{http_code}; Total time: %{time_total}\n","-o","$file_base_name.min.js","--data-urlencode","js_code@$file","http://marijnhaverbeke.nl/uglifyjs"], | |
"selector": "source.js" | |
} |
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
class SaferProxyFix(object): | |
"""This middleware can be applied to add HTTP proxy support to an | |
application that was not designed with HTTP proxies in mind. It | |
sets `REMOTE_ADDR`, `HTTP_HOST` from `X-Forwarded` headers. | |
If you have more than one proxy server in front of your app, set | |
num_proxy_servers accordingly | |
Do not use this middleware in non-proxy setups for security reasons. | |
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
<!--[if mso]> | |
<center> | |
<table><tr><td width="580"> | |
<![endif]--> | |
<div style="max-width:580px; margin:0 auto;"> | |
<p>This text will be centered and constrained to 580 pixels even on Outlook which does not support max-width CSS</p> | |
</div> | |
<!--[if mso]> |
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
mysql -e 'show databases' | while read dbname; do mysqldump --complete-insert --single-transaction "$dbname" | gzip > "$dbname".sql.gz; done |
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 | |
# Get the directory that this script is running from and cd to there | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cd $DIR | |
echo "Deploying $DIR" | |
# tell hyde to rebuild whole site to production_deploy and note the | |
# script will bail out if hyde returns an error | |
hyde gen -c production.yaml -r -d production_deploy/ || exit $? | |
# copy only changed files to the server | |
rsync -cvraz --delete production_deploy/* [email protected]:/var/www/ |
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
<!-- ======================= begin newsletter signup code ======================= --> | |
<style> | |
#ed_signup_box { | |
background: #E8E8E8; | |
margin: 10px 0; | |
padding: 10px; | |
border: 1px solid #D62828; | |
border-radius: 5px; | |
-webkit-border-radius: 5px; | |
-moz-border-radius: 5px; |
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 flask import Request | |
class ProxiedRequest(Request): | |
""" | |
`Request` subclass that overrides `remote_addr` with Frontend Server's | |
HTTP_X_FORWARDED_FOR when available. | |
""" | |
@property | |
def remote_addr(self): |
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
@mixin gradient($from, $to) { | |
background-color: $from; /* fallback/image non-cover color */ | |
background-image: -moz-linear-gradient($from, $to); /* Firefox 3.6+ */ | |
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)); /* Safari 4+, Chrome 1+ */ | |
background-image: -webkit-linear-gradient($from, $to); /* Safari 5.1+, Chrome 10+ */ | |
background-image: -o-linear-gradient($from, $to); /* Opera 11.10+ */ | |
// extras from http://www.colorzilla.com/gradient-editor/ | |
background: -ms-linear-gradient(top, $from 0%,$to 100%); /* IE10+ */ | |
background: linear-gradient(to bottom, $from 0%,$to 100%); /* W3C */ | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$from', endColorstr='$to',GradientType=0 ); /* IE6-9 */ |