Confused!? Yeah, me too ... Zanox' developer center is super-confusing and even finding the documentation for the correct API was tough. I had to realize that our app should access the Publisher API, which kind of makes sense but I didn't look at it first because I was thinking it's for publishing items to Zanox.
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
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind. | |
// Hat tip Paul Irish | |
(function($){ | |
var o = $( {} ); | |
$.subscribe = o.on.bind(o); | |
$.unsubscribe = o.off.bind(o); | |
$.publish = o.trigger.bind(o); | |
})(jQuery); |
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
function f(){ | |
if [[ $VIRTUAL_ENV != /Users/anton/.virtualenvs/fundedbyme ]]; | |
then | |
workon fundedbyme | |
fi | |
cdvirtualenv | |
} | |
function r(){ | |
f |
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 u in User.objects.all(): | |
if u.email not in ['msn@antonagestam.se','appel268576@gmail.com']: | |
u.email = '%s@example.com' % u.username | |
u.save() |
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
function dev(){ | |
f | |
sass --watch fundedbyme/static/css/sass:fundedbyme/static/css --style compressed & | |
rabbitmq-server -detached & | |
open /Applications/Postgres.app & | |
} |
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
# … | |
###### AWS SETTINGS | |
AWS_MEDIA_BUCKET_NAME = AWS_MEDIA_CUSTOM_DOMAIN = 'media.mysite.com' | |
AWS_STATIC_BUCKET_NAME = AWS_STATIC_CUSTOM_DOMAIN = 'static.mysite.com' | |
###### END AWS SETTINGS |
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
\{% url (?!(?:\'|\"))(.*?)( .*?) ?%} |
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
# Move contents of dir to current dir | |
function level_up(){ | |
temp_name="_$1_temp" | |
mv $1 $temp_name; mv $temp_name/{,.}* .; rmdir $temp_name; | |
} |
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
function __shcmd_complete(){ | |
echo "COMPLETING WOHO!" | |
tput rc | |
tput ed | |
echo "COMPLETING WOHO!" | |
export READLINE_LINE="uh-huh" | |
} | |
function read_completion(){ | |
set -o emacs |
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 json | |
from .utils import copy_body | |
class JSONRequest(dict): | |
def __init__(self, request): | |
try: | |
data = json.loads(copy_body(request)) | |
self.is_valid = True |
OlderNewer