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 | |
sudo docker images | grep '<none>' | awk '{print $3}' | xargs echo | xargs sudo docker rmi |
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
// | |
// TestMacros.h | |
// MaidMock | |
// | |
// Created by mattak on 2014/04/18. | |
// | |
// TestMacros for c string. | |
// usage: XCTAssertString("expect string", "check string"); | |
#define XCTAssertCString(expect,cstring) XCTAssertEqualObjects([NSString stringWithUTF8String:expect], [NSString stringWithUTF8String:cstring]) |
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/bash | |
function _error_exit() { | |
echo "$1" 1>&2 | |
exit 1 | |
} | |
# | |
# main | |
# |
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 | |
FILE=$HOME/var/log/script/$(date '+%Y-%m-%d/%H_%M_%S').log | |
DIR=$(dirname $FILE) | |
if [ "$1" == "list" ]; then | |
find $DIR -type f -name '*.log' | |
exit 0 | |
elif [ "$1" == "last" ]; then | |
find $DIR -type f -name '*.log' | tail -1 |
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/bash | |
if [ -z "$1" ]; then | |
echo "usage: $0 <database>" | |
exit 1 | |
fi | |
DATABASE=$1 | |
DIR=$HOME/var/mysql/$DATABASE/$(date +'%Y_%m_%d') | |
FILE=$(date +'%Y-%m-%d_%H%M%S.sql') |
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/bash | |
$* | |
if [ $? -eq 0 ]; then | |
TITLE="success" | |
else | |
TITLE="failed" | |
fi |
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/bash | |
if [ $# -ne 2 ]; then | |
echo "please specify 2 branch" | |
exit 1 | |
fi | |
TMP_FILE1=/tmp/_branch1.commits | |
TMP_FILE2=/tmp/_branch2.commits |
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/bash | |
TARGET_NAME=$1 | |
CMD_ANDROID=android | |
CMD_EMULATOR=emulator | |
SYSTEM_TARGET_IMAGE="Google Inc.:Google APIs (x86 System Image):19" | |
DEVICE_COUNT=$($CMD_ANDROID list avd | grep Name: | grep $TARGET_NAME | wc -l | xargs echo) | |
if [ $DEVICE_COUNT -gt 0 ]; then | |
$CMD_ANDROID delete avd -n $TARGET_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
cat ~/bin/avd-delete | |
#!/bin/bash | |
TARGET_NAME=$1 | |
CMD_ANDROID=android | |
DEVICE_COUNT=$($CMD_ANDROID list avd | grep Name: | grep $TARGET_NAME | wc -l | xargs echo) | |
if [ $DEVICE_COUNT -gt 0 ]; then | |
$CMD_ANDROID delete avd -n $TARGET_NAME | |
fi |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.12.+' | |
} | |
} | |
apply plugin: 'android' |