Skip to content

Instantly share code, notes, and snippets.

View pagenoare's full-sized avatar

Kacper Krupa pagenoare

View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pygnite import *
@get('/')
def index(request):
index.headers = { 'Content-type' : 'text/plain' }
# index.status = 200
return 'Hello world'
Index: gluon/restricted.py
===================================================================
--- gluon/restricted.py (wersja 989)
+++ gluon/restricted.py (kopia robocza)
@@ -77,7 +77,8 @@
cPickle.dump(d, open(os.path.join(errors_folder, f), 'wb'))
- return '%s/%s' % (a, f)
+ #return '%s/%s' % (a, f)
application: juno
version: 1
runtime: python
api_version: 1
handlers:
- url: .*
script: main.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from pygnite import *
@get('/all/#:page?')
def index(request):
return 'Hello world'
#127.0.0.1 - - [05/Jul/2009 21:14:48] "GET /all/aa HTTP/1.1" 404 -
@pagenoare
pagenoare / .xinitrc
Created October 16, 2009 21:12
Xkb file for PL letters on macbook.
#!/bin/bash
xkbcomp $HOME/.Xkb $DISPLAY &> /dev/null
exec wmii
@pagenoare
pagenoare / zaprzyjaznione.cpp
Created December 3, 2009 21:36
Wyszukaj liczby zaprzyjaźnione z przedziału...
macbook $ time ./zaprzyjaznione
Podaj przedział: 1500
284 i 220 są liczbami zaprzyjaźnonymi
1210 i 1184 są liczbami zaprzyjaźnonymi
real 0m4.903s
user 0m3.616s
sys 0m0.000s
@pagenoare
pagenoare / thumbs.diff
Created January 21, 2010 22:28
better image quality in thumbs.py (django) -> http://djangothumbnails.com/
--- thumbs.py 2009-06-08 20:11:41.000000000 +0200
+++ thumbs2.py 2010-01-23 14:48:25.000000000 +0100
@@ -5,7 +5,7 @@
"""
from django.db.models import ImageField
from django.db.models.fields.files import ImageFieldFile
-from PIL import Image
+from PIL import Image, ImageFilter
from django.core.files.base import ContentFile
import cStringIO
@pagenoare
pagenoare / __init__.py
Created April 18, 2010 16:37
Fork of napi.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Based on http://napi.py.googlepages.com/napi.py
import sys
import os
import hashlib
import sys
import urllib
# coding: utf-8
from django import forms
class Invite(forms.Form):
email = forms.EmailField(required=True)
@pagenoare
pagenoare / np.py
Created December 20, 2010 21:05
now-playing in py
import feedparser
user = 'pagenoare'
d = feedparser.parse('http://ws.audioscrobbler.com/1.0/user/%s/recenttracks.rss' % user)
title = d.entries[0].title.encode('utf-8')
print title