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
$counter = 0; | |
$curr = $("#start"); | |
$curr.css("-webkit-transform", "translate3d(0,0,0)"); | |
$curr.css("-moz-transform", "translate(0,0)"); | |
$curr.append("<div><img src='" + image[$counter] + "'></div>"); | |
$counter = 1; | |
$currnext = $curr.next(); |
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
# python | |
export PYTHONDONTWRITEBYTECODE=1 | |
export PYTHONSTARTUP="~/.pythonrc" |
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
set -e | |
GAELIBROOT="/usr/local/google_appengine/" | |
PORT=80 | |
ADDRESS=127.0.0.1 | |
# custom paths for where to store data | |
DATA=$ROOT/$ID/data | |
LOGS=$ROOT/$ID/logs | |
SRC=$ROOT/$ID/src |
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() { | |
var engines = [ | |
['Google', 'q', /\.google\./ ], | |
['Yahoo!', 'p', /search\.yahoo\./ ], | |
['MSN', 'q', /\.msn\./ ], | |
['Live', 'q', /\.live\./ ], | |
['AlltheWeb', 'q', /\.alltheweb\./ ], | |
['AOL', 'query', /\.aol\./ ], | |
['Ask', 'q', /\.ask\./ ], | |
['AltaVista', 'q', /\.altavista\./ ], |
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 _gauges = _gauges || []; | |
(function () { | |
var h = (_gauges['slice']) ? _gauges.slice(0) : []; | |
_gauges = { | |
track_referrer: true, | |
image: new Image(), | |
track: function () { | |
this.setCookie('_gauges_cookie', 1, 1); | |
var a = this.url(); | |
if (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
trackGAEvent("pin", "clicked", "add_dialogue"); | |
trackGAEvent("pin", "success", "add_dialogue"); | |
trackGAEvent("rearrange_board_save", "clicked"); | |
trackGAEvent("rearrange_board_save", "success"); | |
trackGAEvent("send_message", "clicked"); | |
trackGAEvent("send_message", "success"); | |
trackGAEvent("follow_board", "clicked"); |
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
"\e[1~": beginning-of-line | |
"\e[4~": end-of-line | |
"\e[5~": history-search-backward | |
"\e[6~": history-search-forward | |
"\e[3~": delete-char | |
"\e[2~": quoted-insert | |
"\e[5C": forward-word | |
"\e[5D": backward-word | |
"\e\e[C": forward-word | |
"\e\e[D": backward-word |
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
# | |
# variable for the root folder for the project, expected that "src" dir | |
# sites underneath the root. | |
# | |
# ex: APPROOT=/users/<username>/sites/<projectname> | |
# | |
APPROOT='' | |
nosetests \ | |
--config=$APPROOT/.noserc \ |
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 logging | |
from google.appengine.api.labs.taskqueue import taskqueue | |
from google.appengine.datastore import entity_pb | |
from google.appengine.ext import db | |
from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError | |
def put_failsafe(e, db_put_deadline=20, retry_countdown=60, queue_name='default'): | |
"""Tries to e.put(). On success, 1 is returned. If this raises a db.Error | |
or CapabilityDisabledError, then a task will be enqueued to try to put the | |
entity (the task will execute after retry_countdown seconds) and 2 will be |
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 VersionedModel(BaseModel): | |
is_history_copy = db.BooleanProperty(default=False) | |
version = db.IntegerProperty() | |
created = db.DateTimeProperty(auto_now_add=True) | |
edited = db.DateTimeProperty() | |
user = db.UserProperty(auto_current_user=True) | |
def put(self, **kwargs): | |
if self.is_history_copy: | |
if self.is_saved(): |