Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Meuer AlexMeuer

View GitHub Profile
@AlexMeuer
AlexMeuer / logging_module.dart
Created Jul 26, 2020
copy-pastable injectable logger config
View logging_module.dart
import 'package:injectable/injectable.dart';
import 'package:logger/logger.dart';
@module
abstract class LoggingModule {
@lazySingleton
Logger get logger;
@dev
@injectable
@AlexMeuer
AlexMeuer / dart.json
Last active Mar 18, 2021
VSCode User Snippets and Settings
View dart.json
{
"Part statement": {
"prefix": "pts",
"body": [
"part '${TM_FILENAME_BASE}.g.dart';",
],
"description": "Creates a filled-in part statement"
},
"Part 'Freezed' statement": {
"prefix": "ptf",
@AlexMeuer
AlexMeuer / GCP & Firebase Stylish Themes
Last active Mar 6, 2020
Solarized Stylish themes for GCP and Firebase
We couldn’t find that file to show.
View keybase.md

Keybase proof

I hereby claim:

  • I am alexmeuer on github.
  • I am alexmeuer (https://keybase.io/alexmeuer) on keybase.
  • I have a public key ASD06fODX_mVCYdBLG2-PCxeWrgVL_riC2ITz16s8sJAtQo

To claim this, I am signing this object:

@AlexMeuer
AlexMeuer / ViewUtil.java
Created Feb 7, 2018
Utility class for performing common color animations on Views. (Use of `MoreObjects` can be replaced with a turnary if you really hate Guava.)
View ViewUtil.java
package foo.bar.baz;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.support.annotation.ColorInt;
import android.support.annotation.FloatRange;
@AlexMeuer
AlexMeuer / Background.java
Created Feb 7, 2018
Very simple utility class for running stuff on an executor. Depends on Google Guava (written with 'com.google.guava:guava:23.3-android')
View Background.java
package foo.bar.baz;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.Callable;
@AlexMeuer
AlexMeuer / LatoTextView.java
Created Feb 5, 2018
Adaptation of https://gist.github.com/AlexMeuer/fb38958e1f154a0fef4e9738df83a49c for a single font. No need to add xml attributes for the same font everywhere if you can just swap out all the TextViews with a custom class.
View LatoTextView.java
package foo.bar.baz;
import android.content.Context;
import android.graphics.Typeface;
import android.support.annotation.IntDef;
import android.util.AttributeSet;
import com.google.common.collect.ImmutableMap;
import java.lang.annotation.ElementType;
@AlexMeuer
AlexMeuer / CustomFontTextView.java
Created Sep 6, 2017
Basic extension of Android's TextView to allow declaring the use of custom fonts via xml. Assumes fonts are inside 'assets/fonts/' but this can be changed in `applyFont(..)`.
View CustomFontTextView.java
package foo.bar.baz;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import foo.bar.R;
@AlexMeuer
AlexMeuer / SequentialFileDownloader.java
Created Aug 15, 2017
Downloads files one by one to the app's internal storage. Logs a warning if a file already exists but does not stop the download. Uses guava for string testing.
View SequentialFileDownloader.java
package foo.bar
import android.content.Context;
import android.support.annotation.FloatRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.WorkerThread;
import android.util.Log;
import com.google.common.base.Strings;
@AlexMeuer
AlexMeuer / HighlightableBitmapDrawable.java
Created Aug 9, 2017
Simple Drawable extension to allow highlighting regions of a single image. Also allows an overlay to be drawn on top of the selection (I've use a bitmap for the overlay, but using a color instead is straightforward and follows the same technique as darkening the surrounding area).
View HighlightableBitmapDrawable.java
package foo.bar;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.BitmapDrawable;
import android.support.annotation.ColorRes;