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
MobileSafari_PID=$(ps x | grep "MobileSafari" | grep -v grep | awk '{ print $1 }') | |
if [ "$MobileSafari_PID" == "" ]; then | |
echo "Mobile Safari.app must be running in the Simulator to enable the remote inspector." | |
else | |
cat <<EOM | gdb -quiet > /dev/null | |
attach $MobileSafari_PID | |
p (void *)[WebView _enableRemoteInspector] | |
detach |
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
namespace :test do | |
desc "run headless test" | |
task :run do | |
tg = ENV['target']; | |
runner = 'tmp.sh' | |
unless tg | |
puts "an argument required: target=path_to_test.hml" | |
exit |
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
.element-invisible { | |
position: absolute !important; | |
height: 1px; width: 1px; | |
overflow: hidden; | |
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ | |
clip: rect(1px, 1px, 1px, 1px); | |
} | |
/* Hide only visually, but have it available for screenreaders: h5bp.com/v */ | |
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } |
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
fs8=`ruby -e "print '$1'.sub(/\.png$/, '-fs8.png')"` | |
if test -e "$fs8"; then | |
rm $fs8 | |
echo "rm $fs8\n" | |
fi | |
todataURI() | |
{ | |
openssl base64 -in $fs8 | awk -v ext="png" '{ str1=str1 $0 }END{ print "data:image/"ext";base64,"str1 }' | pbcopy | |
} |
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
data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw== |
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
$.when( | |
sushi_roll(), | |
dispatch() | |
).done(function() { | |
console.log('accepted:', arguments[0], arguments[1]); | |
}); | |
var n = 0; | |
function dispatch() { | |
return $.Deferred(function(dispached) { |
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 | |
confbase = 'git-ssh-create' | |
init_command = 'git --bare init' | |
server = `git config --global #{confbase}.server`.chomp | |
if server.empty? | |
warn "Please set git config server." | |
warn " git config --global #{confbase}.server '[username@]yourserver.example.com'" | |
exit 1 |
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 | |
file = ENV['TM_FILEPATH'] | |
if file =~ /\.t$/ | |
local = ENV['LOCAL_PROJECT_ROOT'] | |
remote = ENV['REMOTE_PROJECT_ROOT'] | |
path = file.sub local, remote | |
else | |
local = ENV['TEST_LOCAL_DIR'] |
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
エンジニアの人って割と白黒のログ眺めてる人が多い気がしますが、僕は何かと色つけたい派ですね。 | |
bash に | |
ctail(){ tail -f $1 | perl -pe 's/'$2'/\033\[1;35m$&\033\[0m/gi'; } | |
と書いて | |
ctail /var/log/system.log "(error|exception|unable)" | |
とかやってます |
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
app.is_android2p2 = (navigator.userAgent ||"").search(/Android\s*2.2/) > -1 ? true:false; |