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
$ git push origin gh-master | |
error: src refspec gh-master does not match any. | |
error: failed to push some refs to 'git@github.com:jheasly/first-news-app.git' | |
... | |
$ git push | |
fatal: The current branch gh-pages has no upstream branch. | |
To push the current branch and set the remote as upstream, use |
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
# -*- coding: utf-8 -*- | |
import getpass | |
import httplib2 | |
import gspread | |
from apiclient import discovery | |
from oauth2client import keyring_storage | |
''' | |
Almost entirely cribbed from tarbell/oauth.py |
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
from django.views.generic.list_detail import object_list | |
from foo.models import Baz | |
... | |
def foo(request): | |
response = object_list( | |
request, | |
queryset = Baz.objects.order_by('date'), | |
template_name = 'my_template.html', |
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
from django.http import HttpResponse | |
from django.template import RequestContext, loader | |
from foo.models import Baz | |
... | |
def foo(request): | |
queryset = Baz.objects.order_by('date') | |
template_name = 'my_template.html' | |
mimetype = 'text/plain' |
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
#main/contexts.py | |
from django.core.urlresolvers import resolve, Resolver404 | |
def appname(request): | |
try: | |
app_label = resolve(request.path).app_name | |
except Resolver404: | |
app_label = None | |
return {'appname': app_label} |
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
<script type="text/javascript"> | |
$(document).ready(function(){ | |
jwplayer('mediaplayer').setup({ | |
id: 'playerID', | |
width: 546, | |
height: 313, | |
file: 'http://s3.amazonaws.com/headsup.orcasinc.com/video/concussion_video.mp4', | |
image: 'http://s3.amazonaws.com/headsup.orcasinc.com/video/concussion_video.jpg', | |
modes: [ | |
{type: 'html5'}, |
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
#! /usr/bin/env /opt/local/bin/jython | |
# -*- coding: utf-8 -*- | |
from java.lang import * | |
from java.sql import * | |
def main(): | |
import sys, datetime, cPickle, codecs | |
sys.path.append('/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/') | |
from BeautifulSoup import BeautifulSoup | |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from BeautifulSoup import BeautifulSoup | |
import tagfile, datetime, sys, re, pickle, psycopg2 | |
from os import environ | |
sys.path.append('/directory/nuther_directory') | |
sys.path.append('/directory/nuther_directory/project_directory') | |
environ['DJANGO_SETTINGS_MODULE'] = 'project_directory.settings' | |
from turin.models import Story, Image, Mugline |
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
def removeNonASCII(file): | |
""" remove non-ASCII chars from file, after making a bakup first | |
""" | |
fileBak = "%s.bak" % (file) | |
err = os.system("cp -p %s %s" % (file, fileBak)) | |
if err: | |
return | |
fout = open(fileBak, 'w') | |
for line in fileinput.input(file): | |
fout.write(re.sub(r'[\x80-\xff]', '', line)) |
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
/* | |
Tweak of unified namespace query for use in plain ol' namespace. Based on query by Aaron Kuehn. | |
May 9, 2013: Added dt_cms_schema.Mapping.version to SELECT. | |
*/ | |
select | |
dt_cms_schema.publication.name "Publication Name", | |
dt_cms_schema."section".name "Section Name", | |
dt_cms_schema.slotreference.name "Slot Name", | |
dt_cms_schema.Mapping.version "Version", |
OlderNewer