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 haystack.forms import FacetedSearchForm | |
| class ShowResultsSearchForm(FacetedSearchForm): | |
| """ | |
| This example extends the FacetedSearchForm - you could just as easily extend SearchForm | |
| """ | |
| def __init__(self, *args, **kwargs): | |
| super(BrowseFilterSearchForm, self).__init__(*args, **kwargs) |
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 pyrax | |
| RACK_USER = "..." | |
| RACK_API_KEY = "..." | |
| pyrax.set_setting("identity_type", "rackspace") | |
| pyrax.set_credentials(RACK_USER, RACK_API_KEY, region="LON" ) | |
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
| /* | |
| /* CSS */ | |
| .expose{ | |
| position:'relative'; | |
| background-color:'#fff'; | |
| z-index:1050; | |
| } | |
| */ | |
| function expose(el) { | |
| el.addClass("exposed"); |
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 : http://stackoverflow.com/questions/785519/how-do-i-remove-all-pyc-files-from-a-project | |
| http://stackoverflow.com/questions/785519/how-do-i-remove-all-pyc-files-from-a-project |
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
| //via: http://www.catswhocode.com/blog/mastering-the-html5-audio-property | |
| <audio id="player" src="http://www.sounddogs.com/sound-effects/104/mp3/490284_SOUNDDOGS__ch.mp3"></audio> | |
| <a onclick="document.getElementById('player').play()" >Cheer</a> |
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.core.cache import cache | |
| cache.clear() |
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
| description "launch django app with gunicorn and new relic monitoring" | |
| start on net-device-up | |
| stop on shutdown | |
| respawn | |
| # this cd's into your app's base dir | |
| chdir /var/www/<appname>/ | |
| # this sets the path to your newrelic.ini file |
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
| # hat-tip: Sven Marnach | |
| # http://stackoverflow.com/questions/5817209/browse-files-and-subfolders-in-python | |
| htmlfiles = [os.path.join(root, name) | |
| for root, dirs, files in os.walk(path) | |
| for name in files | |
| if name.endswith((".html", ".htm"))] |
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
| # given a list such as: | |
| # list = [{'title':title, 'date': x.created_on}, ...] | |
| # you can sort on a dict key like such | |
| list.sort(key=lambda item:item['date'], reverse=True) | |
| #source: http://stackoverflow.com/questions/652291/sorting-a-list-of-dictionary-values-by-date-in-python |
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
| /* | |
| It makes sense to use the built-in jquery dialog. But (IMO), the styling on them looks like it was done back a systems administrator. Here are a few lines of css to make them look a little less clunky | |
| */ | |
| /** | |
| Main colors: | |
| dark: #545454 | |
| light: #ccc | |
| */ | |
| .ui-dialog {border: solid 4px #545454;border-radius:0px;padding:0px;-moz-box-shadow: 3px 3px 4px #545454;-webkit-box-shadow: 3px 3px 4px #545454;box-shadow: 3px 3px 4px #545454; | |
| /* For IE 8 */ |