Skip to content

Instantly share code, notes, and snippets.

Erik erikcox

Block or report user

Report or block erikcox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
erikcox / colors.xml
Created Mar 3, 2017
Android Material Design Colors
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Material Design - Color Palette -->
<!-- -->
<!-- Red -->
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
erikcox / hide_keyboard.xml
Created Sep 22, 2016
Hide the soft keyboard on Activity load in Android
View hide_keyboard.xml
<!-- AndroidManifest.xml -->
<activity android:name="com.your.package.ActivityName"
android:windowSoftInputMode="stateHidden" />
erikcox /
Created Dec 12, 2015
Progress bar function in Python
def update_progress(progress):
print '\r{1}%[{0}] '.format('#' * (progress/2), str(progress).zfill(2)),
# Useage
data = []
count = 0.0
total = len(data)
print 'Starting...'
# iterate over something and update count
erikcox /
Created Dec 11, 2015
Add git pre-push hook to check for TODO: in comments
# create the pre-commit file & make it executable
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# The line below is important!
# Don't push if TODO is in the source for HEAD
flag_found=`git grep --color "$dont_push_flag" HEAD`
erikcox / SimCityLoadingMessages.txt
Created Nov 11, 2015
A list of loading messages from the game SimCity, which I repurposed for Slack loading messages.
View SimCityLoadingMessages.txt
Adding Hidden Agendas
Adjusting Bell Curves
Aesthesizing Industrial Areas
Aligning Covariance Matrices
Applying Feng Shui Shaders
Applying Theatre Soda Layer
Asserting Packed Exemplars
Attempting to Lock Back-Buffer
Binding Sapling Root System
Breeding Fauna
erikcox /
Created Nov 5, 2015
A grid to help line things up when using graphics in Java
// Paste inside public void paint()
g.setFont(new Font(null));
for ( int X=0; X<800; X += 50 )
g.drawString( String.valueOf(X), X, 50 );
for ( int Y=100; Y<600; Y += 50 )
g.drawString( String.valueOf(Y), 28, Y );
// lines
for ( int X=0; X<800; X += 50 )
View SEOlinks.txt
// One
if(BuildConfig.DEBUG) {
Toast.makeText(this, "Debug mode", Toast.LENGTH_SHORT).show();
// Two
try {
appInfo = pacMan.getApplicationInfo(pacName, 0);
} catch (NameNotFoundException e) {
Toast.makeText(this, "Could not find package " + pacName, Toast.LENGTH_SHORT).show();
# Plug in device via USB first
adb devices
adb tcpip 5555
# Unplug device
adb connect
adb devices
View vim_notes.txt
========== Navigation ==========
CTRL+C OR Ctrl+[ instead of ESC.
1/2 ½ BOL (Begin-of-line)
0 BOL (Begin-of-line)
$ EOL (End-of-line)
H Goto HEADER (Top of the screen)
L Goto last (bottom).
You can’t perform that action at this time.