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
var ignored = ['obama', 'romney', 'paul ryan', 'mittromney', 'biden', 'joebiden', 'barrackobama', 'politico', 'liberal', 'conservative', 'fox news']; | |
var removePolitics = function(){ | |
console.log('Removing political tweets.') | |
var tweets = $('.tweet'); | |
var tweet, tweet_content; | |
for (var i = 0; i < tweets.length; i++) { | |
tweet = $(tweets[i]); | |
tweet_content = tweet.html().toLowerCase(); |
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
export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache | |
export PIP_DOWNLOAD_CACHE=$HOME/.pip_download_cache | |
export PS1="jx:\W$ " | |
# Axiom virtualenvwrapper config | |
. /Users/jg026715/.axiomrc | |
export ORACLE_HOME=/usr/local/lib/instantclient |
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
In [1]: import cropper | |
In [2]: from cropper import models | |
In [3]: from cropper import views | |
--------------------------------------------------------------------------- | |
ImportError Traceback (most recent call last) | |
/home/jason/pybox/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>() | |
----> 1 from cropper import views |
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
In [1]: from django.utils.translation import ugettext as _ | |
In [2]: [_('red'),_('blue')] | |
Out[2]: [u'red', u'blue'] | |
In [3]: [_('red'),_('blue')] | |
TypeError Traceback (most recent call last) | |
/Users/jg026715/.virtualenvs/iqh/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>() | |
----> 1 [_('red'),_('blue')] |
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
In [1]: from django.utils.translation import ugettext as _ | |
In [2]: [_('red'),_('blue')] | |
Out[2]: [u'red', u'blue'] | |
In [3]: [_('red'),_('blue')] | |
TypeError Traceback (most recent call last) | |
/Users/jg026715/.virtualenvs/iqh/lib/python2.7/site-packages/django/core/management/commands/shell.pyc in <module>() | |
----> 1 [_('red'),_('blue')] |
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
FileDiffs | |
Gist | |
Git | |
HTML (Django) | |
Indent XML | |
Pretty JSON | |
SFTP | |
SVN | |
SideBarEnhancements | |
SublimeEvernote |
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 sys | |
if 'runserver' in sys.argv: | |
from django.conf import settings | |
urlpatterns += patterns('', | |
(r'^media/(?P<path>.*)$', 'django.views.static.serve', | |
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), | |
(r'^static/(?P<path>.*)$', 'django.views.static.serve', | |
{'document_root': "%s/static/" % settings.PROJECT_ROOT, 'show_indexes': True}), | |
) |
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
/* | |
SHOEBOX v4.0 | |
*/ | |
// SHIMS | |
//////// | |
if (typeof(log) === 'undefined') { | |
function log(s) { |
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
# {}.get()'s second argument only kicks in if there's no key. | |
# None, '', or falsy values are perfectly okay. | |
# If you actually want ot fall back to a default, use or. | |
In [1]: data = {'red':None} | |
In [2]: data.get('red','backup') | |
In [3]: data.get('red') or 'backup' | |
Out[3]: 'backup' |
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
var ImgWidget = function(){ | |
// Keeps "currently" up to date next to the image widget | |
// HELPERS | |
////////// | |
var _truncate_temp_file = function(filename){ | |
value = filename.split('/'); | |
value = value[0].split('\\'); // appease windows | |
value = value[value.length - 1]; |
OlderNewer