Skip to content

Instantly share code, notes, and snippets.

View TakashiSasaki's full-sized avatar

Takashi SASAKI TakashiSasaki

View GitHub Profile
class MyTest(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
try:
import webtest
except ImportError:
import setuptools.command.easy_install as easy_install
easy_install.main(["WebTest"])
exit()
<script src="https://gist.github.com/4524547.js"></script>
@TakashiSasaki
TakashiSasaki / git-status.txt
Created January 15, 2013 10:03
ISW12Hの設定画面で、HTCアプリのテンポラリファイルを全て削除するというのがある。 https://twitter.com/TakashiSasaki/status/290784605701824512/photo/1/large これで何が削除されるのかを知りたくて削除前の/mnt/sdcardをgitリポジトリに保存して削除後の状態でgit status取ってみた。 結果的には、HtcGreaderというフォルダの下のJPEG画像とDCIM/.thumbnailsの下のサムネイル画像が消されるだけだった。 なので安心して削除して良い。 https://twitter.com/TakashiSasaki/status/290784605701824512
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
#21deleted: .3DFlatten/82F0A94F-1816977.jpg
# deleted: .data/HtcGreader/-1271364895.jpg
# deleted: .data/HtcGreader/-1301349222.jpg
# deleted: .data/HtcGreader/-1484455093.jpg
# deleted: .data/HtcGreader/-1683847924.jpg
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div>カメラ画像!</div>
<input id="ip_address" value="192.168.0.5"/>
<div><img id="jpeg1" src=""/></div>
<script type="text/javascript">
@TakashiSasaki
TakashiSasaki / squid.conf
Last active December 16, 2015 08:29
my squid.conf for QNAP TS-1079 Pro. Actually squid.conf should not modified directly. Use its own web interface.
# The user name and group name Squid will operate as
cache_effective_user httpdusr
cache_effective_group everyone
#
# Recommended minimum configuration:
#
# Auth Method
#auth_param basic program /share/MD0_DATA/.qpkg/Squid/opt/libexec/squid/ncsa_auth /etc/shadow
#auth_param basic children 5
@TakashiSasaki
TakashiSasaki / gist:5412424
Last active December 16, 2015 09:19
JSONバリデータを使ってみるためだけのダミーのJSONデータw
{}
@TakashiSasaki
TakashiSasaki / item.schema.json
Last active December 16, 2015 10:29
対象物とメタデータを関連付けるオブジェクト http://jsonschemalint.com/ でバリデート済み。 *.jsはJSONP版。
{
"$schema": "http://json-schema.org/draft-03/schema",
"id": "https://gist.github.com/TakashiSasaki/5420814/raw/schema.json",
"title": "root",
"title-authority": [
"http://json-schema.org/latest/json-schema-validation.html#anchor97",
"http://json-schema.org/latest/json-schema-core.html#anchor7"
],
"title-description": "Title is a metadata keyword and will preferrably be short.",
"description": null,
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8"/>
<title>minimul HTML document</title>
</head>
<body></body>
</html>
@TakashiSasaki
TakashiSasaki / jsdoit.css
Created April 27, 2013 09:05
forked: JavaScript のオブジェクトを可視化するやーつ
body { background-color: #DDDDDD; font: 12px sans-serif; }
td, th {
border-width: 1px;
border-color: #99a;
border-style: solid;
}
table {
margin: 4px 2px;
@TakashiSasaki
TakashiSasaki / get-all-gae-log.sh
Last active December 16, 2015 18:49
Google App Engine for Pythonアプリの全バージョンの全ログをぶっこ抜く。 Google App Engineでappcfg.pyを使ってログを取得しようとするとバージョン文字列を指定しなければならない。そこで過去にデプロイしたことがあるすべてのバージョン文字列を得る必要があった。なお、バージョン文字列が特定できれば次のコマンドで当該バージョンのログを取得することができる。
appcfg.py --secure --include_all --num_days=0 request_logs /path/to/my/gaeapp\
--version=version_string version_string.log