Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AlexMeuer's full-sized avatar
🇵🇸

Alex Meuer AlexMeuer

🇵🇸
View GitHub Profile
@AlexMeuer
AlexMeuer / open_current_meeting.fish
Last active February 29, 2024 14:50
Open current meeting in zoom (from google calendar via gcalcli)
gcalcli agenda (date) (date -v 23H -v 59M -v 59S) --details=location --tsv \
| awk -v current_time=(date +%H:%M) -F '\t' '{if ($2 <= current_time && $4 > current_time && $6 != "") print $6}' \
| head -n 1 \
| xargs -I {} sh -c "open -a zoom.us {}"
# Escaped fish abbreviation that can be added to `~/config/fish/config.fish`
abbr -a -- zoomq gcalcli\ agenda\ \(date\)\ \(date\ \ -v\ 23H\ -v\ 59M\ -v\ 59S\)\ --details=location\ --tsv\ \|\ awk\ -v\ current_time=\(date +%H:%M\)\ -F\ \'\\t\'\ \'\{if\ \(\$2\ \<=\ current_time\ \&\&\ \$4\ \>\ current_time\ \&\&\ \$6\ !=\ \"\"\)\ print\ \$6\}\'\ \|\ head\ -n\ 1\ \|\ xargs\ -I\ \{\}\ sh\ -c\ \"open\ -a\ zoom.us\ \{\}\"
@AlexMeuer
AlexMeuer / extract_component
Last active November 16, 2023 12:36
Extract prop types and component name
#!/bin/bash
# Assumes that the component file has the prop types above the functional component.
# The prop types may or may not have a JSDoc comment block above them.
# Assumes that the functional component is exported.
if [ $# -eq 0 ]; then
printf "Attempts to extract prop types and component name from a component file.\n"
printf "\e[92mUsage: \e[0m \e[93m%s <file_path>\e[0m\n" "$(basename "${0}")"
printf "\e[92mExample:\e[0m \e[93m%s src/components/MyComponent.tsx | tee /dev/tty | pbcopy\e[0m\n" "$(basename "${0}")"
@AlexMeuer
AlexMeuer / logging_module.dart
Created July 26, 2020 10:35
copy-pastable injectable logger config
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 September 29, 2023 07:49
VSCode User Snippets and Settings
{
"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 March 6, 2020 10:21
Solarized Stylish themes for GCP and Firebase
We couldn’t find that file to show.

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 February 7, 2018 11:15
Utility class for performing common color animations on Views. (Use of `MoreObjects` can be replaced with a turnary if you really hate Guava.)
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 February 7, 2018 11:03
Very simple utility class for running stuff on an executor. Depends on Google Guava (written with 'com.google.guava:guava:23.3-android')
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 February 5, 2018 13:53
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.
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 September 6, 2017 10:23
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(..)`.
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;