Skip to content

Instantly share code, notes, and snippets.

View kyuwoo-choi's full-sized avatar
🎖️
Hello, New World!

KyuWoo Choi kyuwoo-choi

🎖️
Hello, New World!
View GitHub Profile
@kyuwoo-choi
kyuwoo-choi / gist:1390640
Created November 24, 2011 04:45
Check out from multiple svn repos & merge into one git repo
$ git svn clone -s SVN_REPO_URL LOCAL_DIR
$ cd LOCAL_DIR
$ git remote add origin git@github.com:GITHUB_USERNAME/REPO_NAME.git
$ git push origin master
$ git remote add rack_remote git@github.com:schacon/rack.git
$ git fetch rack_remote
warning: no common commits
remote: Counting objects: 3184, done.
@kyuwoo-choi
kyuwoo-choi / gist:1390757
Created November 24, 2011 06:29
Commit to SVN from a git repo
git svn init -s http://example.com/svn/my_proj
git svn fetch
git branch -a
git repack -d

Contributor License Agreement

Thank you for your contribution to this PAIO software project. In order to clarify the intellectual property rights in the project, and to grant licenses to the project to others, PAIO co.,ltd. (“PAIO”) requires that you accept this Contributor License Agreement (“Agreement”). This license is for your protection as a Contributor as well as the protection of PAIO, its users, and its licensees; you may still license your own Contributions under other terms.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to PAIO. Except for the license granted herein to PAIO and recipients of software distributed by PAIO, You reserve all right, title, and interest in and to Your Contributions.

  1. Definitions.

“You” (or “Your”) shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with PAIO. For legal entities, the entity making a Contribution and all other entities that con

@kyuwoo-choi
kyuwoo-choi / commit-msg
Last active April 18, 2017 06:08 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
#!/bin/zsh
source ~/.zshrc #in case your tools do not export path
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
@kyuwoo-choi
kyuwoo-choi / book-collection-simple.js
Last active June 14, 2017 16:08
hello world AOP example
class BookCollection {
...
getByISBN(isbn) {
return this.get({
isbn: isbn
}).then(book => book.name)
.catch(error => null);
}
...
}
@kyuwoo-choi
kyuwoo-choi / book-collection-logging.js
Last active June 14, 2017 16:08
hello world AOP example with logging
class BookCollection {
...
return this.get({
isbn: isbn
}).then(book => {
Logger.info(`Retrieving book ${isbn} - ${book.name} has been succeed`);
return book.name;
}).catch(error => {
Logger.error(`Retrieving book ${isbn} has been failed. ${JSON.stringify(error)}`);
return null;
@kyuwoo-choi
kyuwoo-choi / book-collection-refactored.js
Created June 14, 2017 16:07
hello world AOP example refactored
class BookCollection extends Collection {
...
getNameByISBN(isbn) {
return this.get({
isbn: isbn
}, {
cache: true,
onSuccess: 'name'
onFail: null,
log: {
@kyuwoo-choi
kyuwoo-choi / book-collection-aop-logger.js
Created June 14, 2017 16:10
hello world AOP logger aspect
class LoggerAspect {
...
@afterMethod({
methodNamePattern: /^getNameByISBN$/,
classNamePattern: /^BookCollection$/
})
afterGetNameByISBN(meta) {
let result = meta.method.result;
Logger.info(`Retrieving ${result.isbn} - ${result.name} has been succeed`);
}
@kyuwoo-choi
kyuwoo-choi / book-collection-aop-cache.js
Created June 14, 2017 16:11
hello world AOP cache aspect
class CacheAspect {
...
@beforeMethod({
methodNamePattern: /^get.*/,
classNamePattern: /^[Book|User]Collection$/
})
beforeGet(meta, args) {
let key = `${meta.name}:${args.join()}`;
let method = meta.method;
method.proceed = true;