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
/** | |
* Here is the simplified version. Courtesy of Mike Koss. | |
* | |
* See, http://labnote.beedesk.com/the-pitfalls-of-html5-applicationcache | |
*/ | |
function handleAppCache() { | |
if (applicationCache == undefined) { | |
return; | |
} | |
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
/** | |
* Extracted from: https://github.com/beedesk/jQTouch/commit/b5d2fc63fe15acba15c4e8eaafc0e128997f8484 | |
*/ | |
/* ============= from themes/apple/theme.css ============= */ | |
#jqt > * { | |
-webkit-transform: translate3d(0,0,0); | |
-webkit-backface-visibility: hidden; | |
background: rgb(197,204,211) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAABCAIAAACdaSOZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpiPHrmCgMC/GNjYwNSAAEGADdNA3dnzPlQAAAAAElFTkSuQmCC); | |
-webkit-user-select: ignore; |
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
# /slim/slim.rb | |
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
require 'rubygems' | |
require 'sinatra' | |
class AppMain < Sinatra::Application | |
set :root, APP_ROOT | |
get '/' do |
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
# /config.ru | |
# This file is used by Rack-based servers to start the application. | |
# For Rails | |
require ::File.expand_path('../config/environment', __FILE__) | |
# For Sinatra | |
require './slim/slim.rb' | |
# - Make sinatra play nice | |
use Rack::MethodOverride |
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
# /config.ru | |
# This file is used by Rack-based servers to start the application. | |
# File generated by "rails create MyApp" | |
# For Rails | |
require ::File.expand_path('../config/environment', __FILE__) | |
# For Sinatra | |
require './slim/slim.rb' | |
# - Make sinatra play nice |
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 __future__ import absolute_import | |
import settings | |
from storages.backends.s3boto import S3BotoStorage | |
from boto.s3.connection import SubdomainCallingFormat | |
def getattr_backup(obj, key, backupkey, default): | |
result = getattr(obj, key, None) | |
if result is None: |
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
""" | |
module mydjangolib.bigint_patch | |
A fix for the rather well-known ticket #399 in the django project. | |
Create and link to auto-incrementing primary keys of type bigint without | |
having to reload the model instance after saving it to get the ID set in | |
the instance. | |
Logs: |
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
# Say, you have models `Invoice` and `InvoicePart`. The `InvoicePart` | |
# has a non-nullable field of `Invoice`. | |
# | |
# Currently (August 2012), `tastypie` will throw an error when you try | |
# to create (`HTTP Post`) a new `Invoice` that contains one or more new | |
# `InvoicePart`. | |
# | |
# The problem is that when `tastypie` processes the `InvoicePart`, the | |
# backlink to `Invoice` is not set. | |
# |
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
Running 1 dyno. Does running more dynos get some better treament? | |
``` | |
2013-02-22T04:49:35+00:00 heroku[web.1]: Cycling | |
2013-02-22T04:49:38+00:00 heroku[web.1]: Stopping all processes with SIGTERM | |
2013-02-22T04:49:41+00:00 heroku[web.1]: Process exited with status 143 | |
2013-02-22T04:49:41+00:00 heroku[web.1]: State changed from up to down | |
2013-02-22T04:49:41+00:00 heroku[web.1]: State changed from down to starting | |
2013-02-22T04:49:46+00:00 heroku[web.1]: Starting process with command `newrelic-admin run-program python apps/manage.py runserver 0.0.0.0:40284 --noreload` | |
2013-02-22T04:49:47+00:00 app[web.1]: Validating models... |
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
// CORS | |
app.use(function(req, res, next) { | |
if ('OPTIONS' !== req.method) { | |
if ('origin' in req.headers) { | |
res.setHeader('Access-Control-Allow-Origin', req.headers.origin); | |
} | |
next(); | |
} else { | |
var body = '{}\n'; | |
if ('origin' in req.headers) { |
OlderNewer