This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_name, constraint_name | |
FROM information_schema.table_constraints | |
WHERE | |
table_schema = 'DATABASE_NAME' AND | |
constraint_type= 'FOREIGN KEY' | |
; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
class Cell | |
attr_accessor :n, :s, :e, :w, :visited | |
def initialize(n, s, e, w, visited) | |
@n, @s, @e, @w, @visited = n, s, e, w, visited | |
end | |
def []=(key, value) | |
self.send("#{key.to_s}=", value) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select table_name | |
from `information_schema`.`columns` | |
where table_schema = 'DB_NAME' and column_name = 'DESIRED_COLUMN_NAME'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
set -o errexit | |
CURRENT_BRANCH=$(git branch | grep '\*') | |
git checkout ${1:-"master"} || exit 1 | |
git branch -d ${CURRENT_BRANCH:2} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# Exit if any error is encountered: | |
set -o errexit | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git merge ${CURRENT} | |
git push origin master | |
git checkout ${CURRENT} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -x | |
# Exit if any error is encountered: | |
set -o errexit | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
git checkout master | |
git pull --rebase origin master | |
git checkout ${CURRENT} | |
git rebase master |