Skip to content

Instantly share code, notes, and snippets.

@y-ogi
y-ogi / management.py
Created July 28, 2011 01:07
XML test runner for kay
# -*- coding: utf-8 -*-
#
#
#
import os
import logging
import unittest
import xmlrunner
@y-ogi
y-ogi / gist:1110719
Created July 28, 2011 01:09
for using memcache with interactive shell
from google.appengine.api import apiproxy_stub_map
from google.appengine.api.memcache import memcache_stub
apiproxy_stub_map.apiproxy.RegisterStub('memcache', memcache_stub.MemcacheServiceStub())
@y-ogi
y-ogi / sudoku.py
Created August 12, 2011 06:59
generate sudoku
#!/usr/bin/env python
import random
import copy
NUMS = [1, 2, 3, 4, 5, 6, 7, 8 , 9]
class Sudoku(object):
def __init__(self):
self.box = []
@y-ogi
y-ogi / ReportThings.scpt
Created August 16, 2011 09:59
Copy today's report from Things(Mac App) to clipboard
tell application "Things"
-- define cr and tab
set cr to ASCII character (13)
set tab to " "
set repStr to ""
-- get projects
repeat with pr in projects
@y-ogi
y-ogi / gist:1154254
Created August 18, 2011 15:07
Import from GitHub's Issues to Spreadsheet
var HEADERS = [
'ID',
'By',
'Title',
'Content',
'Created At',
'Updated At',
'Status'
];
@y-ogi
y-ogi / translations.sh
Created December 6, 2011 06:12
i18n helper shell
#!/bin/bash
RETVAL=0
TARGET=$2
PYTHON_BIN=/usr/bin/python2.5
NKF_BIN=/opt/local/bin/nkf
dircheck() {
if [ -d "$1" ]; then
return 1
@y-ogi
y-ogi / gist:1480091
Created December 15, 2011 06:40
deploy google app engine
echo [password] > .password && /usr/bin/python manage.py appcfg update --email=test@test.com --passin -A [appname] < .password
@y-ogi
y-ogi / gist:1563524
Created January 5, 2012 03:08
bulkloader helper shell for GAE
#!/bin/bash
RETVAL=0
APPID=$2
KIND=$3
APPCFG_PY=/usr/local/bin/appcfg.py
download() {
echo "Downloading $KIND..."
@y-ogi
y-ogi / jquery.fillin.coffee
Created February 6, 2012 10:53
jquery plugin (coffee script)
jQuery.fn.fillin = (options) ->
default_options =
border_color: 'red',
background_color: 'red'
options = $.extend {}, default_options, options
# change color
change_color = (el)->
that = $(el)
@y-ogi
y-ogi / gist:2027258
Created March 13, 2012 06:34
model for full text search on google app engine
class InvertedNameIndex(db.Model):
"""
転置Index
名前用の転置Index
"""
word = db.StringProperty(required=True)
keys = db.StringListProperty()
key_template = 'inverted_name_index/%s/%s'