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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
def android(): | |
""" | |
Android用のgitignoreを書き込みます. | |
""" | |
ignore = """bin/ | |
gen/ |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
def write(ignore): | |
""" | |
引数を.gitignoreに書き込みます. | |
""" | |
f = open(".gitignore", "w") |
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
/** | |
* assetsからデータベースをコピーするためのユーティリティクラス | |
* | |
* @author motoki | |
*/ | |
public class DatabaseUtil { | |
/** | |
* コピーを実行する | |
* | |
* @param context |
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
#!/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 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 | |
dir='/home/motoki/Documents' | |
file_count=`ls ${dir} | wc -l` | |
random=`od -vAn -N4 -tu4 < /dev/random` | |
rnum=$(( ${random} % $file_count )) | |
count=0 | |
for f in `ls ${dir}`; do | |
if [ "${rnum}" -eq "${count}" ]; then |
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
package ho.ge; | |
/* | |
結果 | |
Main | |
Canonical: ho.ge.Main | |
Name: ho.ge.Main | |
Simple: Main | |
----- | |
Annoymous |
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
#! /bin/sh | |
CURRENT=`pwd` | |
screen | |
cd ${CURRENT} |
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 python | |
# -*- coding: utf-8 -*- | |
from urllib import urlopen | |
import json | |
import sys | |
base_url = 'https://api.github.com/users/{username}/gists?page=' | |
def fetch(username): | |
def fetch(page): |
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
angular.module('AngularStudy', []).directive 'ndClick', => ($scope, $element, $attrs) => | |
isTap = isTapped = false | |
$element.bind 'click', => $scope.$apply $attrs['ndClick'] unless isTapped | |
$element.bind 'touchstart', => isTap = true | |
$element.bind 'touchmove', => isTap = false | |
$element.bind 'touchend', => if isTap | |
isTapped = true | |
$scope.$apply $attrs['ndClick'], $element |
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
timestamp() { | |
printf '%ld\n' $(expr `date +%s%N` / 1000000) | |
} |