This file contains 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
#!/usr/bin/env ruby | |
require 'time' | |
# usage | |
# resetdate.rb *.jpg | |
ARGV.each do |file| | |
exif = {} | |
`jhead #{file}`.strip.split("\n").each do|exif_data| | |
k,v = exif_data.split(/ +: /) |
This file contains 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
git co master; git pull; git co -; git merge master |
This file contains 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
# snipet ( abbreviation: code.. ) | |
---------------------- | |
```@cursor``` | |
---------------------- | |
# example | |
----- before --------- | |
1234567890 | |
1234567890 |
This file contains 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
<? | |
function hash_value($obj, $keys){ | |
if(empty($keys)) return $obj; | |
$key = array_shift($keys); | |
if(isset($obj[$key])){ | |
return hash_value($obj[$key], $keys); | |
}else{ | |
return ''; | |
} | |
} |
This file contains 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
sed -e 's/.\[[0-9]\{1,2\}m//g' colored.log |
This file contains 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
class MySQL | |
def initialize(database, password, user = 'root') | |
@database = database | |
@password = password | |
@user = user | |
end | |
def select(sql) | |
rows = [] | |
`mysql -u#{@user} -p#{@password} #{@database} -e "#{sql} \\G"`.strip.split(/\*\*\*\*.*/).each do |result| |
This file contains 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
function peco-kill(){ | |
proc=`ps aux | peco` | |
pid=`echo "$proc" | awk '{print $2}'` | |
echo "kill pid:$pid. [$proc]" | |
kill $pid | |
} |
This file contains 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
function peco-hist() { | |
time_column=`echo $HISTTIMEFORMAT | awk '{printf("%s",NF)}'` | |
column=`expr $time_column + 3` | |
cmd=`history | tac | peco | sed -e 38;5;208m's/^ //' | sed -e 's/ +/ /g' | cut -d " " -f $column-` | |
history -s "$cmd" | |
eval $cmd | |
} |
This file contains 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
class MySQL | |
def initialize(database) | |
@database = database.to_s | |
end | |
def exec(sql) | |
if sql =~ /\.sql$/ and File.exists? sql | |
sql = File.read(sql, encoding: Encoding::UTF_8) | |
end |
This file contains 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
# bash_completion | |
merged_branch () { | |
local branches | |
local input=$2 | |
branches=`git b --no-color --merged | grep -v master` | |
# echo $branches | |
COMPREPLY=($(compgen -W '$branches' -- $input)) | |
} | |
# Delete Remote(pub) and Local Branch. |
OlderNewer