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
| #element { | |
| -webkit-transform: scale(0.75), rotateY(0deg), translate(0, 20px); | |
| } | |
| #element:hover { | |
| -webkit-transform-scale: 1.0; | |
| -webkit-transform-translate: 0, 0; | |
| } | |
| #element.flipped { |
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
| function getElementTransitionDuration(elem, property) { | |
| // this currently only supports Webkit browsers, but should be easy enough to apply to others as they begin to support CSS transitions | |
| var td = elem ? window.getComputedStyle(elem)['-webkit-transition-duration'].split(', ') : [], | |
| tp = elem ? window.getComputedStyle(elem)['-webkit-transition-property'].split(', ') : [], | |
| durations = {}, | |
| longest = 0, | |
| i = td.length; | |
| while( --i ) { | |
| var dur = parseFloat(td[i], 10); | |
| if(i < tp.length) { |
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
| function getElementScale(elem) { | |
| var transform = /matrix\([^\)]+\)/.exec(window.getComputedStyle(elem)['-webkit-transform']), | |
| scale = {'x': 1, 'y': 1}; | |
| if( transform ) { | |
| transform = transform[0].replace('matrix(', '').replace(')', '').split(', '); | |
| scale.x = parseFloat(transform[0]); | |
| scale.y = parseFloat(transform[3]); | |
| } | |
| return scale; | |
| } |
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 django import template | |
| from django.conf import settings | |
| import urllib, hashlib | |
| register = template.Library() | |
| class GravatarUrlNode(template.Node): | |
| def __init__(self, email): | |
| self.email = template.Variable(email) |
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
| AWS_ACCESS_KEY_ID = 'your_key_goes_here' | |
| AWS_SECRET_ACCESS_KEY = 'your_secret_key_goes_here' | |
| AWS_STORAGE_BUCKET_NAME = 'your_bucket_name_goes_here' |
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
| #!/usr/bin/env python | |
| sites = [ | |
| 'google.com', | |
| ] | |
| USE_BOXCAR = True | |
| USE_GROWL = True | |
| BOXCAR_EMAIL = '' | |
| BOXCAR_API_KEY = '' |
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
| /* normal clients -- desktops */ | |
| #header a.logo { | |
| padding-left: 210px; | |
| background: url('/images/logo-200x200.png') no-repeat 0 50%; /* this is our original graphic at say 200x200px */ | |
| } | |
| /* older iPhones, Android, Palm, etc. assuming that their screen is 480px long on the longest side */ |
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
| // JavaScript for converting @replies, #hashtags, and URLs to links. If you have jQuery on the page, it will also look for yfrog images and photos and embed them as well. | |
| // put this at the top of your file | |
| var isMobile = (navigator.userAgent.toLowerCase().match('mobile') && navigator.userAgent.toLowerCase().match('webkit')); | |
| // run this on each tweet | |
| if( typeof jQuery == 'object' && tweet.text.indexOf('http://yfrog.') > -1 ) { | |
| var yfrogurl_start = tweet.text.search(/http:\/\/yfrog\.com\/([A-Z0-9]+)/i); | |
| var yfrogurl_end = tweet.text.substr(yfrogurl_start + 17).search(/(\s|$)/); | |
| if( yfrogurl_start == -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
| class RemoveWWW(object): | |
| def process_request( self, request ): | |
| try: | |
| if request.META['HTTP_HOST'].lower().find('www.') == 0: | |
| from django.http import HttpResponsePermanentRedirect | |
| return HttpResponsePermanentRedirect( request.build_absolute_uri().replace('//www.', ‘/') ) | |
| except: | |
| pass | |
| return None |