Skip to content

Instantly share code, notes, and snippets.

@krtek
krtek / __init__.py
Last active December 25, 2015 14:59
Secure access to AppEngine application with webapp2.
from utils import SecureApplication
routes = (
('/route1', 'app.views.view1'),
)
handler = SecureApplication(routes=routes, debug=settings['DEBUG'])
@krtek
krtek / gist:4991591
Created February 20, 2013 00:23
ZT - Unicorn puzzle solution
public class MagicalLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {