Skip to content

Instantly share code, notes, and snippets.

create table member (
id INT NOT NULL AUTO_INCREMENT COMMENT 'ID',
name VARCHAR(100) DEFAULT '' NOT NULL COMMENT '氏名',
created_date DATETIME NOT NULL COMMENT '作成日時',
updated_date DATETIME NOT NULL COMMENT '更新日時',
deleted_date DATETIME COMMENT '削除日時',
version INT DEFAULT 0 NOT NULL COMMENT 'オプティミスティックロック用',
CONSTRAINT member_pk PRIMARY KEY(id)
) COMMENT = 'メンバー' DEFAULT CHARSET=UTF8;
@troter
troter / mercurial-introduction.rst
Created October 30, 2011 09:51
SCMBC #2 Mercurial入門セッション資料(のたたき台) move to https://bitbucket.org/troter/scmbc-2011.11-mercurial-introsession

Mercurial 入門セッション資料

この資料について

  • SCMBC #2 Mercurial 入門セッション資料(のたたき台)です。
  • TODO たとえ話募集中

(おまけ)分散バージョン管理全般の利点

@troter
troter / gist:1290799
Created October 16, 2011 11:57
aircastle/flaskrのimportの依存関係
digraph {
"flaskr.__init__.py" -> "flasker.util.db"
"flaskr.__init__.py" -> "flasker.controller.general"
"flaskr.__init__.py" -> "flasker.controller.user"
"flaskr.__init__.py" -> "flasker.controller.entry"
"flaskr.__init__.py" -> "flasker.controller.comment"
"flasker.controller.comment" -> "flaskr.model.entry"
"flasker.controller.comment" -> "flaskr.model.comment"
"flasker.controller.comment" -> "flaskr.controller.form"
@troter
troter / gist:1289101
Created October 15, 2011 05:30
finally timing
% python [31909]
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def g():
... try:
... yield 1
... finally:
... print "finished"
...
@troter
troter / gyazowin+.ini
Created October 9, 2011 08:20
MemocurialのGyazo機能
[gyazowin+]
upload_server=timedia.memocurial.com
upload_path=/gyazo?prefix=http:%2F%2Ftimedia.memocurial.com
@troter
troter / gist:1225257
Created September 18, 2011 16:47
mercurialの内部APIを利用してファイルのコンテンツをとる
import os
from mercurial import hg, ui
path = "/home/takumi/"
repo = hg.repository(ui.ui(), path)
ctx = repo['tip']
#print ctx.filectx('.zshenv').data()
mf = ctx.manifest()
#!/bin/bash
# force-one-head
# add the following to <repository>/.hg/hgrc :
# [hooks]
# pretxnchangegroup.forceonehead = /path/to/force-one-head
if [ $(hg heads --template "{branch}\n"|sort|uniq|wc -l) != $(hg heads --template "{branch}\n"|sort|wc -l) ]; then
echo "There are multiple heads."
echo "Please 'hg pull' and get your repository up to date first."
echo "Also, don't 'hg push --force' because that won't work either."
@troter
troter / hgrc
Created September 2, 2011 05:27
hg fix "fixed message" # (hg 1.8.x only)
# hgrc
[extensions]
mq =
hgshelve = $HOME/.mercurial/extensions/hgshelve/hgshelve.py
[alias]
# fix latest commit message (hg 1.8.x only)
fix = ! \
$HG shelve --all -n 'tmp.hg-fix' && \
import java.lang.reflect.InvocationTargetException;
public interface InterfaceName {
String getValue();
int getLength();
/**
* InterfaceName で定義しておいて欲しいクラスメソッドを定義
@troter
troter / update
Created August 1, 2011 16:20
update any repositories.
#!/bin/bash
[ -d .git ] && git pull
[ -d .hg ] && hg pull -u
[ -d .svn ] && svn update
[ -d .bzr ] && bzr update