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 | |
TIMESTAMP=`date +'%s'`$(printf '%03d' $(expr `date +%N` / 1000000)) | |
SCREEN_SHOT_NAME=screen_shot_${TIMESTAMP}.png | |
adb shell /system/bin/screencap -p /sdcard/${SCREEN_SHOT_NAME} | |
adb pull /sdcard/${SCREEN_SHOT_NAME} ~/${SCREEN_SHOT_NAME} | |
adb shell rm /sdcard/${SCREEN_SHOT_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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from subprocess import PIPE, Popen | |
import os | |
import sys | |
def get_current_window_name(): | |
for i in Popen(['xprop', '-root'], stdout=PIPE).stdout: | |
if '_NET_ACTIVE_WINDOW(WINDOW):' in i: | |
for j in Popen(['xprop', '-id', i.split()[4]], stdout=PIPE).stdout: |
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
/** | |
* assetsからデータベースをコピーするためのユーティリティクラス | |
* | |
* @author motoki | |
*/ | |
public class DatabaseUtil { | |
/** | |
* コピーを実行する | |
* | |
* @param context |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import datetime | |
import time | |
import os | |
from stat import * | |
import commands | |
def watch(dir, command): |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
def write(ignore): | |
""" | |
引数を.gitignoreに書き込みます. | |
""" | |
f = open(".gitignore", "w") |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
def android(): | |
""" | |
Android用のgitignoreを書き込みます. | |
""" | |
ignore = """bin/ | |
gen/ |
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
gbmec() { | |
git status | awk '/both modified:/{print $4}' | xargs emacsclient | |
} |
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 python | |
# -*- coding: utf-8 -*- | |
import popen2 | |
import re | |
def extractBothModifiedFileName(): | |
r, w, e = popen2.popen3('git status') | |
for line in r: | |
if not line.find('both modified:') is -1: | |
yield re.split('[\t ]*', line.strip())[-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 python | |
# -*- coding: utf-8 -*- | |
from optparse import OptionParser | |
import pynotify | |
def notify(app_name, title, message): | |
icon = 'dialog-information' | |
if app_name is None: | |
app_name = 'app_name' | |
if title is None: |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import time | |
import subprocess | |
from threading import Thread | |
import signal |