Skip to content

Instantly share code, notes, and snippets.

View hameno's full-sized avatar

Philip Porto Schiffer hameno

View GitHub Profile
@Morgul
Morgul / Readme.md
Last active July 7, 2019 09:16
Rocket.Chat Docker deployment and update script

Rocket.Chat Docker Deployment

Setup

  1. Pull down all of the files from this gist.
  2. Update <<YOUR_URL_HERE>> in docker-compose.yml and <<YOUR_PROJECT_NAME_HERE>> in update.sh.
  3. Run ./update.sh.

From this point onward, you just run ./update.sh whenever you want to update your docker image. Alternatively, you can put the update script in a cron job, and update it however often you want.

@mcginty
mcginty / material_colors.xml
Last active March 17, 2022 04:09
Android XML resource with the full material color palette. Source: http://www.google.com/design/spec/style/color.html#color-color-palette
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="material_red50">#ffffebee</color>
<color name="material_red100">#ffffcdd2</color>
<color name="material_red200">#ffef9a9a</color>
<color name="material_red300">#ffe57373</color>
<color name="material_red400">#ffef5350</color>
<color name="material_red500">#fff44336</color>
<color name="material_red600">#ffe53935</color>
<color name="material_red700">#ffd32f2f</color>
@daj
daj / BaseStatelessBlackBoxEspressoTest.java
Last active December 20, 2018 09:44 — forked from xrigau/AndroidManifest.xml
The set of changes required to disable animations any time Espresso tests run. These instructions will only work on emulators and on rooted devices. This is based on the instructions in: https://code.google.com/p/android-test-kit/wiki/DisablingAnimations
public abstract class BaseStatelessBlackBoxEspressoTest<T extends Activity> extends ActivityInstrumentationTestCase2<T> {
private SystemAnimations mSystemAnimations;
public BaseStatelessBlackBoxEspressoTest(Class clazz) {
super(clazz);
}
@Override
protected void setUp() throws Exception {
@benjchristensen
benjchristensen / EventBus.java
Last active February 24, 2022 03:02
EventBus.java
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
/**
* Simple pass-thru event bus with error handling and reconnect.
*/
public class EventBus {
@JakeWharton
JakeWharton / Truss.java
Last active June 9, 2023 07:35
Extremely simple wrapper around SpannableStringBuilder to make the API more logical and less awful. Apache 2 licensed.
import android.text.SpannableStringBuilder;
import java.util.ArrayDeque;
import java.util.Deque;
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE;
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */
public class Truss {
private final SpannableStringBuilder builder;
private final Deque<Span> stack;
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@anorth
anorth / ZoomLayout.java
Created March 29, 2014 00:06
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
package com.asynctask.util;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import java.io.InterruptedIOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.concurrent.Callable;
@jamiehuson
jamiehuson / JacksonConverter
Created September 16, 2013 21:32
A Jackson Converter for use with Square's Tape queue library
public class JacksonConverter<T> implements FileObjectQueue.Converter<T> {
private final ObjectMapper mMapper;
private final Class<T> mType;
public JacksonConverter(ObjectMapper mapper, Class<T> type) {
this.mType = type;
this.mMapper = mapper;
}
@romannurik
romannurik / AndroidCreateGhostIcon.java
Created June 14, 2013 06:28
Android ColorMatrixColorFilter example: Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). In the ghost bitmap, the RGB values take on the values from the 'color' argument, while the alpha values are derived from the source's grayscaled RGB values. The effect is that you can see through darker parts of the …
/**
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable).
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while
* the alpha values are derived from the source's grayscaled RGB values. The effect is that
* you can see through darker parts of the source bitmap, while lighter parts show up as
* the given color. The 'invert' argument inverts the computation of alpha values, and looks
* best when the given color is a dark.
*/
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) {
int width = src.getIntrinsicWidth();