Skip to content

Instantly share code, notes, and snippets.

View kiy0taka's full-sized avatar
🔒

Kiyotaka Oku kiy0taka

🔒
View GitHub Profile
@kiy0taka
kiy0taka / データ移行.md
Last active August 8, 2017 23:46 — forked from chihiro-adachi/データ移行.md
データ移行.md

3.0.x - > 3.nへのデータ移行

3.0.xのデータを抽出し、DataFixtureで読み込み可能なCSVへ変換する

以下の操作で3.0.xデータを3.nで移行できるようにする(イメージ)

cd /path/to/eccube30
php app/console convert::3n /path/to/eccube3n/src/Resouce/doctrine/import_csv
@kiy0taka
kiy0taka / tree.md
Created April 24, 2012 09:56 — forked from timyates/tree.md
A one-line tree in Groovy

One line Tree in Groovy

The other day, I saw Harold Cooper's One-line tree in Python via autovivication, and wondered if the same thing was possible in Groovy.

The answer is yes! But you need to define the variable tree before you can assign it to the self-referential withDefault closure, hence with Groovy, it's a two-line solution ;-)

Anyway, given:

def tree = { [:].withDefault{ owner.call() } }
@kiy0taka
kiy0taka / user_stream.groovy
Created June 11, 2011 08:57 — forked from irof/gist:1020274
twitter4j-streamを使ってみる
@Grab('org.twitter4j:twitter4j-stream:2.2.3')
import twitter4j.*
new TwitterStreamFactory().instance.with {
addListener([onStatus:{println "@${it.user.screenName}: ${it.text}"}] as UserStreamAdapter); user()
}
// PostgreSQL
@GrabConfig(systemClassLoader=true)
@Grab('postgresql:postgresql:9.0-801.jdbc4')
def sql = groovy.sql.Sql.newInstance(
"jdbc:postgresql://host.example.org/database",
"username", "password", "org.postgresql.Driver")
// MySQL
@GrabConfig(systemClassLoader=true)
@kiy0taka
kiy0taka / commit-irc.groovy
Created September 9, 2010 04:40 — forked from kiy0taka/commit-irc.groovy
Using Groovy to Git post-commit hook: IRC Bot to print commit Message
@Grab('pircbot:pircbot:1.4.2')
import org.jibble.pircbot.*;
def (host, port, channel) = ['<Server>', <Port>, '<Channel>']
def bot = [:] as PircBot
bot.name = 'groovy_bot'
bot.encoding = 'ISO-2022-JP'
bot.connect host, port
bot.joinChannel channel