Skip to content

Instantly share code, notes, and snippets.

😇
Hello

Yoichi Fujimoto wozozo

😇
Hello
View GitHub Profile
View Search ZendFramework Manual (Ubiquity)
makeSearchCommand({
name: "zf",
url: "http://www.google.co.jp/search?client=safari&rls=en-us&q=site:framework.zend.com/manual/en {QUERY}&ie=UTF-8&oe=UTF-8",
icon: "http://framework.zend.com/favicon.ico",
description: "Search ZendFramework Manual (en)",
});
View gist:140000
from juno import *
@route('/')
def index(web):
return 'Hello, World'
run()
View gist:140003
from juno import *
Person = model('Person', name='str', views='int')
@route('/makeperson/*:name/')
def makeperson(web, name):
exist = Person.find().filter(Person.name==name)
if exist.count() != 0: return 'That person already exists'
p = Person(name=name, views=0).save()
return 'Person created'
View gist:163456
#!/opt/local/bin/python
# -*- coding: utf-8 -*-
import os
import urllib
import re
SAVE_DIR = '/tmp/foobar'
View gist:264605
#!/usr/bin/env python
# coding: utf-8
import logging
import time
def main():
while(1):
time.sleep(1)
logging.warn(u'ちんこ')
View gist:289884
# coding: utf-8
class Q(object):
"""
>>> q = Q(2)
>>> q.put('a', 1)
>>> q.put('b', 2)
>>> q.put("c", 3)
>>> q.get("a")
>>> q.get('b')
View gist:298907
#!/opt/local/bin/python
# -*- coding: utf-8 -*-
import timeit
t = timeit.Timer(stmt="dict(a='aaaaa',b='bbbbb',c='ccccc',d='ddddd',e='eeeee')")
for i in range(5):
print 'dict: %s' % t.timeit(number=1000000)
t = timeit.Timer(stmt="{'a':'aaaaa','b':'bbbbb','c':'ccccc','d':'ddddd','e':'eeeee'}")
View gist:323713
<?php
$a = '1-a';
$a = ++$a;
$a = ++$a;
$a = ++$a;
$a = ++$a;
$a = ++$a;
$a = ++$a;
$a = ++$a;
$a = ++$a;
View gist:327343
<?php
var_dump(get_defined_functions());
/*
array(2) {
["internal"]=>
array(1525) {
[0]=>
string(12) "zend_version"
[1]=>
View gist:336652
(function(){
var a = function(){};
a.prototype = {
hello: function(){
alert('hello');
}
};
window.a = new a();
})();
You can’t perform that action at this time.