Skip to content

Instantly share code, notes, and snippets.

View polbins's full-sized avatar
🏔️

polbins polbins

🏔️
View GitHub Profile
@Intyre
Intyre / Wahoo_Elemnt.md
Last active April 11, 2024 06:52
Wahoo Elemnt - Tips, tricks and custom images
@mrk-han
mrk-han / change-accessibility-settings-with-adb.md
Last active March 7, 2024 09:52
Enable and Disable Android Accessibility Settings from the Command Line using ADB (Font scale, talkback, color blind)

Using ADB to control Accessbility settings for easier testing with Android Emulators + Real Devices

It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.

These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.

Credit to James Nitsch for inspiring this, and for figuring out the put commands to enable these settings.

Font Scale (Font Size -- Testing Dynamic Text)

@XLNCs
XLNCs / AdobeFixAMD
Last active March 21, 2024 15:33
To fix adobe products crashes on AMD hackintosh
MOVED HERE:
https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd
package statemachine
import debug
import fail
import io.reactivex.Observable
import kotlinx.coroutines.experimental.channels.Channel
import kotlinx.coroutines.experimental.channels.produce
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
import kotlinx.coroutines.experimental.runBlocking
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email 'firstname.lastname@gov.bc.ca'
    
@yangweigbh
yangweigbh / NetworkEventProvider.java
Last active January 18, 2021 10:35
Class to listen to network change
public interface NetworkEventProvider {
void setListener(Listener listener);
interface Listener {
/**
* @param networkStatus {@link com.birbit.android.jobqueue.network.NetworkUtil.NetworkStatus}
*/
void onNetworkChange(@NetworkUtil.NetworkStatus int networkStatus);
}
}
@ultraon
ultraon / build.gradle
Last active August 19, 2020 18:10
Good example of the merged Jacoco code covarage Gradle configuration
apply plugin: 'com.android.application'
apply from: "$rootDir/coverage.gradle"
//...
android {
//...
buildTypes {
//...
debug {
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@andymatuschak
andymatuschak / States-v3.md
Last active May 1, 2024 12:32
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@mugifly
mugifly / magnum-ci-build-android-apk-and-post-to-slack.md
Last active November 24, 2017 11:40
Build of Android Studio Project and Post the apk to Slack from Magnum CI

Build of Android Studio Project and Post the apk to Slack from Magnum CI

  • Build the Android Studio Project (Gradle Project) which exist on your Git repository.
  • Upload the generated apk file to Slack.

Basic Setup

  • Name: YOUR-REPOSITORY-NAME
  • Repository URL: git@github.com:XXX/YYY.git
  • Provider: Github
  • Source control: Git
  • Project type: Generic