Skip to content

Instantly share code, notes, and snippets.

View aegis123's full-sized avatar

Dylan Drost aegis123

View GitHub Profile
@aegis123
aegis123 / Keybase.io
Created March 21, 2018 20:24
Keybase.io
### Keybase proof
I hereby claim:
* I am aegis123 on github.
* I am dylandrost (https://keybase.io/dylandrost) on keybase.
* I have a public key ASCycHMVHGBt_kwEgUfPcxm4ENzoBN8rW8NTDRkpZPl2gwo
To claim this, I am signing this object:
@aegis123
aegis123 / firebase test devices
Created January 24, 2017 15:27
Firebase test devices as of january 24, 2017
+-------------+----------+--------------------+----------+-------------+----------------+---------+
| DEVICE_ID | MAKE | MODEL_NAME | FORM | RESOLUTION | OS_VERSION_IDS | TAGS |
+-------------+----------+--------------------+----------+-------------+----------------+---------+
| D6503 | Sony | Xperia Z2 | PHYSICAL | 1920 x 1080 | 21 | |
| D6603 | Sony | Xperia Z3 | PHYSICAL | 1920 x 1080 | 21 | |
| E5803 | Sony | Xperia Z5 Compact | PHYSICAL | 1280 x 720 | 22 | |
| F5121 | Sony | Sony Xperia X | PHYSICAL | 1920 x 1080 | 23 | |
| Nexus10 | Samsung | Nexus 10 | VIRTUAL | 2560 x 1600 | 19,21,22 | beta |
| Nexus4 | LG | Nexus 4 | VIRTUAL | 1280 x 768 | 19,21,22 | beta |
| Nexus5 | LG | Nexus 5 | VIRTUAL | 1920 x 1080 | 19,21,22,23 | beta |
@aegis123
aegis123 / verify blockchain
Created January 19, 2016 10:05
Verifying that +dylandrost is my blockchain ID. https://onename.com/dylandrost
Verifying that +dylandrost is my blockchain ID. https://onename.com/dylandrost
@aegis123
aegis123 / DateSerializer.java
Created December 17, 2014 15:07
A Gson Serializer/Deserializer for java.util.Date objects.
public class DateTypeDeserializer implements JsonDeserializer<Date>, JsonSerializer<Date> {
private static final String[] DATE_FORMATS = new String[]{
"yyyy-MM-dd'T'HH:mm:ssZ",
"yyyy-MM-dd'T'HH:mm:ss",
"yyyy-MM-dd",
"EEE MMM dd HH:mm:ss z yyyy",
"HH:mm:ss",
"MM/dd/yyyy HH:mm:ss aaa",
"yyyy-MM-dd'T'HH:mm:ss.SSSSSS",
"yyyy-MM-dd'T'HH:mm:ss.SSSSSSS",
@aegis123
aegis123 / rules.pro
Created December 15, 2014 13:16
ProGuard and DexGuard rules
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
#your package path where your gson models are stored
-keep class com.project.models.** { *; }
@aegis123
aegis123 / ViewPager.java
Created July 23, 2014 14:57
Viewpager bug not accounting for Page Margin
public class SlowViewPager extends ViewGroup {
@Override
public boolean onTouchEvent(MotionEvent ev) {
// all normal Viewpager onTouch code
switch (action & MotionEventCompat.ACTION_MASK) {
case MotionEvent.ACTION_UP:
if (mIsBeingDragged) {
final VelocityTracker velocityTracker = mVelocityTracker;
velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
@aegis123
aegis123 / functions.php
Created December 9, 2013 12:41
nav menu for genesis framework theme with responsive twitter bootstap
/* Custom Code */
// ENQUEUE SCRIPS & STYLES FOR BOOTSTRAP
add_action('genesis_before_header', 'responsive_nav');
function responsive_nav() {
wp_register_style( 'bootstrap-css', get_stylesheet_directory_uri() . '/css/bootstrap.css');
wp_enqueue_style( 'bootstrap-css' );
wp_register_script( 'bootstrap-js', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', array('jquery'), false, true );
wp_enqueue_script( 'bootstrap-js' );
}
@aegis123
aegis123 / API.java
Created August 8, 2013 15:32
Connect to server with okHttp + mimecraft
public abstract class API {
private static BackendResponse getResponseWithOKHttp(Context context, Request req,
List<NameValuePair> nvp, boolean hasMedia) {
if (req != Request.DEVICE_CREATE && !Utils.deviceIsCreated(context)) {
// NOTE Houston, We've Got a Problem, try again!
BackendResponse br = createDevice(context, null);
if (br.isOK()) {
Utils.storeTokens(context, br.getJSON());
} else {
return br;
@aegis123
aegis123 / SomeClass.java
Created July 17, 2013 14:20
encode a string with Base64 url safe and no padding
byte[] digist;
Base64.encodeToString(digest, Base64.URL_SAFE | Base64.NO_PADDING);
@aegis123
aegis123 / someclass.java
Last active December 17, 2015 01:59
Open an App on the Play store
protected void OpenAppInPlay() {
Uri uri = Uri.parse("market://details?id="/** put package name of app here. */);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(browserIntent);
}