View java
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
public static String msToString(long ms) { | |
long totalSecs = ms/1000; | |
long hours = (totalSecs / 3600); | |
long mins = (totalSecs / 60) % 60; | |
long secs = totalSecs % 60; | |
String hrsString = (hours == 0) | |
? "00" | |
: ((hours < 10) | |
? "0" + hours | |
: "" + hours); |
View Arduino: led_blink_schemes
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
int const PIN_FRONT = 3; | |
int const PIN_BELLY = 5; | |
int const PIN_DEFAULT = 8; | |
int const INPUT_PIN = 2; | |
//input reading stuff | |
int inputReading = LOW; | |
int previousRead; | |
long time = 0; // the last time the output pin was toggled |
View square mask android
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
<?xml version="1.0" encoding="utf-8" ?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | |
<!-- view background color --> | |
<solid android:color="@color/transparent"> | |
</solid> | |
<!-- view border color and width --> | |
<stroke android:width="100dp" android:color="@color/white"> | |
</stroke> | |
<!-- If you want to add some padding --> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"> |
View circle mask android
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
<?xml version="1.0" encoding="utf-8" ?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring"> | |
<!-- view background color --> | |
<solid android:color="@color/transparent"> | |
</solid> | |
<!-- view border color and width --> | |
<stroke android:width="56dp" android:color="@color/white"> | |
</stroke> | |
<!-- If you want to add some padding --> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp"> |
View gist:417331e1228bd8ea1bf4
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
// Immutable -- returns an unmodifiable List instead | |
public class SafeStates { | |
private final String[] states = new String[] { "Alabama", "Alaska", ... }; | |
private final List statesAsList | |
= new AbstractList() { | |
public Object get(int n) { | |
return states[n]; | |
} |
View gist:751477dd96e1bcdb42ad
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
adb shell 'pm list packages -f' |
View reset_properties
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
git status | grep .properties | awk '{print $2}' | xargs git checkout |
View Alpha Transparency codes
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
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 | |
60% — 99 | |
55% — 8C |