Skip to content

Instantly share code, notes, and snippets.

View mattak's full-sized avatar
👨‍💻
working

Takuma Maruyama mattak

👨‍💻
working
View GitHub Profile
@mattak
mattak / sample.geojson
Last active August 29, 2015 13:56
tokyo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattak
mattak / arec
Last active August 29, 2015 13:57
Android Record Program.
#!/bin/sh
SCREENRECORD_ANDROID_PATH=/sdcard/tmp.mp4
SCREENRECORD_LOCAL_PATH=tmp.mp4
TIME=10
SIZE=960x540
if [ $# -ge 1 ]; then
SCREENRECORD_LOCAL_PATH=$1
fi
@mattak
mattak / expect-android-update.sh
Last active August 29, 2015 13:57
type 'y' when update android sdk. usage : expect-android-update.sh sysimg-19
#!/bin/bash
OPTIONS="--no-ui --all --filter"
expect -c "
set timeout -1
spawn android update sdk $OPTIONS $@
expect {
\"Do you accept the license\" {
#!/bin/sh
# Delete all containers
sudo docker rm $(sudo docker ps -a -q)
# Delete all images
sudo docker rmi $(sudo docker images -q)
@mattak
mattak / dcc
Created March 31, 2014 07:35
docker clean container
#!/bin/sh
sudo docker rm $(sudo docker ps -a -q)
@mattak
mattak / irc.sh
Created April 2, 2014 02:05
irc post script with a single message.
#!/bin/sh
if [ $# -ne 4 ]; then
echo "usage: <server> <nick> <channel> <message>"
echo "ex: irc.example.com bot #chatroom hello"
exit
fi
SERVER=$1
PORT=6667
@mattak
mattak / emulatorwait.sh
Last active August 29, 2015 13:58
android emulator wait script.
#!/bin/sh
echo "please launch after: emulator -avd TARGET -no-window -no-boot-anim -no-audio"
# wait for launch
result=""
while [ -z "$result" ]; do
sleep 5
adb kill-server
adb start-server
@mattak
mattak / convertsize.rb
Created April 9, 2014 01:32
convert size of image
#!/usr/bin/env ruby
if ARGV.size < 1
puts "usage: <stdin list of files> | convertsize.rb <size>"
exit 0
end
STDIN.each do |line|
line.chomp!
src = line
@mattak
mattak / agif
Created April 10, 2014 01:21
animation gif from mp4 files
#!/usr/bin/env ruby
def run(cmd)
puts "$ #{cmd}"
`#{cmd}`
end
if ARGV.size < 1 || /.mp4$/i !~ ARGV[0]
puts "usage: agif <something.mp4>"
exit 0
@mattak
mattak / dsr
Last active August 29, 2015 13:58
docker stop container & remove container by grepping
#!/bin/sh
# docker stop & remove
if [ $# -lt 1 ]; then
echo "usage: dsr <grep word>"
exit 0
fi
grepword=$1