Skip to content

Instantly share code, notes, and snippets.

Avatar
🎖️
Hello, New World!

KyuWoo Choi kyuwoo-choi

🎖️
Hello, New World!
View GitHub Profile
@kyuwoo-choi
kyuwoo-choi / gist:1390640
Created Nov 24, 2011
Check out from multiple svn repos & merge into one git repo
View gist:1390640
$ 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 Nov 24, 2011
Commit to SVN from a git repo
View gist:1390757
git svn init -s http://example.com/svn/my_proj
git svn fetch
git branch -a
git repack -d
View CLA.md

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 Apr 18, 2017 — forked from wesbos/commit-msg
ESLint 3.0 Git Pre Commit Hook
View commit-msg
#!/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 Jun 14, 2017
hello world AOP example
View book-collection-simple.js
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 Jun 14, 2017
hello world AOP example with logging
View book-collection-logging.js
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 Jun 14, 2017
hello world AOP example refactored
View book-collection-refactored.js
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 Jun 14, 2017
hello world AOP logger aspect
View book-collection-aop-logger.js
class LoggerAspect {
...
@afterMethod({
methodNamePattern: /^getNameByISBN$/,
classNamePattern: /^BookCollection$/
})
afterGetNameByISBN(meta) {
let result = meta.method.result;
Logger.info(`Retrieving ${result.isbn} - ${result.name} has been succeed`);
}
View book-collection-aop-cache.js
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;