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
class Picture(db.Model): | |
name = db.StringProperty() | |
ext = db.StringProperty() | |
mime_type = db.StringProperty() | |
source = db.BlobProperty() | |
thumb = db.BlobProperty() | |
default = db.BlobProperty() | |
caption = db.StringProperty() | |
updated_at = db.DateTimeProperty() |
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
class ApiHandler(webapp.RequestHandler): | |
def check_uploaded_picture(self): | |
if not self.check_api_key(): | |
self.error_response(401, API_ERROR_UNAUTHORIZED) | |
return False | |
if not self.request.get('picture'): | |
self.error_response(400, API_ERROR_MISSING) | |
return False |
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
class PictureResource(ApiHandler): | |
def post(self, name, ext): | |
if not self.check_uploaded_picture(): | |
return | |
picture = Picture.find(name, ext) | |
if not picture: | |
picture = Picture() |
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
# 1.8.7 only (boo fucking hoo) | |
return key.shuffle!.to_s | |
key = key.sort_by { rand } | |
return key.to_s |
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
<?php | |
/** | |
* Checks if the field is a valid email address according to RFC 2822 | |
* | |
* @package repository | |
* @subpackage rules | |
*/ | |
class ComplexEmailRule extends ValidationRule { |
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
<div class="element element-input"> | |
<label for="element_input">element-input</label> | |
<input type="text" name="element_input"> | |
<span class="element-help">This is a short help drescription...</span> | |
</div> |
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
# | |
# w00t! | |
# thanks to @pamelafox | |
# http://google-wave-resources.googlecode.com/svn/trunk/samples/apps/inboxchecker/oauth.py | |
# | |
import wsgiref.handlers | |
import logging | |
import pickle | |
import uuid |
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: ISTANBUL, TURKEY | |
TO: STATE DEPARTMENT | |
DATE: JUNE 1, 2005 | |
CLASSIFICATION: CONFIDENTIAL | |
SEE FULL CABLE | |
After briefly basking in the reflected glow of last week's exciting UEFA Champion's League Final in Istanbul between Milan and Liverpool, corporate sponsor Mastercard has found itself dealing with a public relations nightmare in recent days following public criticism of inclusion in its match city guide of critical commentary about both Turkey and its revered founder, Mustafa Kemal Ataturk. The offending passages, first publicized in the liberal Islamist daily "Zaman," addressed the issue of Turkish-Kurdish relations and the Armenian tragedy of 1915. Mastercard briefly closed its office following death threats against its General Manager, and has since officially apologized, noting that the offending material had not been reviewed by any company officials, but instead emanated from the "Lonely Planet," which produced the bulk of the publication. The public reaction, which has also included calls for a |
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
desc "Deploy site" | |
task :deploy do | |
sh %{git push origin master} | |
sh %{ssh server "cd /var/www/XXXXX.com;git pull;bundle check || bundle;rake db:migrate;touch tmp/restart.txt;chown -R app:app *"} | |
end |
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
$ cd lib | |
$ git clone [email protected]:maetl/floe.git floe | |
$ cd floe | |
$ git remote add upstream [email protected]:maetl/floe.git | |
$ git fetch upstream |