Skip to content

Instantly share code, notes, and snippets.

View drcarter's full-sized avatar

Daniel Yoon drcarter

View GitHub Profile
@drcarter
drcarter / keep_adb.sh
Created September 30, 2016 02:44
adb 연결이 끊기는거 방지 script.
#!/bin/bash
function monitor_adb () {
adb start-server
echo "[$(date)] adb started"
while [ "$(adb shell echo 1)" ]; do sleep 5; done
echo "[$(date)] adb is broken, restarting"
@drcarter
drcarter / hexagon bitmap image
Last active August 29, 2015 14:15
hexagon bitmap image converter.
private Bitmap getHexagonImage(Bitmap toTransform) {
Bitmap output = Bitmap.createBitmap(toTransform.getWidth(),
toTransform.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(output);
int radius = 0;
int width = toTransform.getWidth();
int height = toTransform.getHeight();
int centerX = width / 2;
int centerY = height / 2;