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
| /* | |
| A.P. Shield 05 Demo Program | |
| Created by @shigaku / KORESS | |
| http://koress.jp/ | |
| http://twitter.com/shigaku | |
| */ | |
| int sensorPin = 4; | |
| int ledPin = 13; | |
| int sensorValue = 0; |
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
| #!/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 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
| git co master; git pull; git co -; git merge master |
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
| # snipet ( abbreviation: code.. ) | |
| ---------------------- | |
| ```@cursor``` | |
| ---------------------- | |
| # example | |
| ----- before --------- | |
| 1234567890 | |
| 1234567890 |
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
| <? | |
| 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 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
| sed -e 's/.\[[0-9]\{1,2\}m//g' colored.log |
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
| 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 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 | |
| case $1 in | |
| config) | |
| cat <<'EOM' | |
| graph_title Temperature | |
| graph_vlabel Temperature | |
| temperature.label temperature | |
| EOM | |
| exit 0;; |
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
| function peco-kill(){ | |
| proc=`ps aux | peco` | |
| pid=`echo "$proc" | awk '{print $2}'` | |
| echo "kill pid:$pid. [$proc]" | |
| kill $pid | |
| } |
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
| 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 | |
| } |
OlderNewer