Skip to content

Instantly share code, notes, and snippets.

View michilu's full-sized avatar

ENDOH takanao michilu

  • JAPAN
View GitHub Profile
@michilu
michilu / views.py
Created May 13, 2011 23:23
KeyError: '_service' in kay.ext.gaema.models.GAEMAUser.get_or_insert, discus for http://groups.google.com/group/kay-users-ja/browse_thread/thread/5a842d604c36d7a4
Traceback (most recent call last):
File "test0/kay/lib/werkzeug/wsgi.py", line 466, in __call__
return app(environ, start_response)
File "test0/kay/app.py", line 475, in __call__
response = self.get_response(request)
File "test0/kay/app.py", line 406, in get_response
return self.handle_uncaught_exception(request, exc_info)
# -*- coding: utf-8 -*-
import pickle
from google.appengine.ext import db
from kay.ext.gaema.models import GAEMAUser
class User(GAEMAUser):
name = db.StringProperty()
<!DOCTYPE html>
<html xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
{% if number %}
{% set results = [results[number-1]] %}
{% set title = results[0].title + " - " %}
{% set lang = results[0].lang %}
{% set ogtype = "article" %}
{% set ogurl = "/" + number.__str__() %}
{% endif %}
<head>
@michilu
michilu / patch.diff
Created September 22, 2011 07:22
Install gettext on Mac OS lion
diff --git a/gettext-tools/gnulib-lib/stpncpy.c b/gettext-tools/gnulib-lib/stpncpy.c
index ca53ebb..5a97b84 100644
--- a/gettext-tools/gnulib-lib/stpncpy.c
+++ b/gettext-tools/gnulib-lib/stpncpy.c
@@ -31,7 +31,7 @@
/* Copy no more than N bytes of SRC to DST, returning a pointer past the
last non-NUL byte written into DST. */
char *
-__stpncpy (char *dest, const char *src, size_t n)
+__stncpy (char *dest, const char *src, size_t n)
sudo mkdir /Users/Shared/Jenkins/Home
sudo chown daemon:daemon /Users/Shared/Jenkins
sudo chown daemon:daemon /Users/Shared/Jenkins/Home
sudo chmod g+w /Users/Shared/Jenkins
sudo chmod g+w /Users/Shared/Jenkins/Home
@michilu
michilu / gist:3328359
Created August 12, 2012 00:56
Iteration over list slices
from itertools import chain, islice
def divide(sequence, size):
"""
>>> [i for i in divide(range(10), 3)]
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
>>> [i for i in divide('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 3)]
['ABC', 'DEF', 'GHI', 'JKL', 'MNO', 'PQR', 'STU', 'VWX', 'YZ']
"""
i = 0
@michilu
michilu / functools_timeit.py
Created October 12, 2012 00:04 — forked from kumagi/lru.py
python lru benchmarks
#!/usr/bin/env python
from functools32 import lru_cache
from time import time
import random
import sys
def benchtime(fn):
oldtime = time()
fn()
return time() - oldtime
@michilu
michilu / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
package main
import (
"fmt"
"unsafe"
"github.com/google/flatbuffers/go"
)
var (
// paiWidget
;(function($){
$.widget('ui.paiWidget',{
options: {
wrapElmId : '',
img : {
src : '',
zoom : 1,
ow : 640,