Skip to content

Instantly share code, notes, and snippets.

Avatar
🌞

polbins polbins

🌞
View GitHub Profile
@mrk-han
mrk-han / change-accessibility-settings-with-adb.md
Last active Dec 22, 2021
Enable and Disable Android Accessibility Settings from the Command Line using ADB (Font scale, talkback, color blind)
View change-accessibility-settings-with-adb.md

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 Dec 31, 2021
To fix adobe products crashes on AMD hackintosh
View AdobeFixAMD
MOVED HERE:
https://gist.github.com/naveenkrdy/26760ac5135deed6d0bb8902f6ceb6bd
View PureStateMachineWithEffects.kt
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 Dec 9, 2021
Setup git on the CLI to use 2FA with GitHub
View setup-gh-cli-auth-2fa.md

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 Jan 18, 2021
Class to listen to network change
View NetworkEventProvider.java
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 Aug 19, 2020
Good example of the merged Jacoco code covarage Gradle configuration
View build.gradle
apply plugin: 'com.android.application'
apply from: "$rootDir/coverage.gradle"
//...
android {
//...
buildTypes {
//...
debug {
@nesquena
nesquena / PatternEditableBuilder.java
Last active Dec 8, 2021
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
View PatternEditableBuilder.java
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 Jan 4, 2022
A composable pattern for pure state machines with effects (draft v3)
View States-v3.md

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 Nov 24, 2017
Build of Android Studio Project and Post the apk to Slack from Magnum CI
View magnum-ci-build-android-apk-and-post-to-slack.md

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
@andkon
andkon / outdoors.md
Last active Sep 22, 2020
Toronto Outdoors
View outdoors.md

Spring/summer/fall (in order of distance)

  • Daytrip list
  • Tobermory swimming holes/grotto
  • Bruce Peninsula National Park - you can book backcountry sites here. Very chill hike, but really beautiful. I came from the east parking lot and then got a ride back to my car, but you could definitely just park at the main campground, camp at site HD6 (or thereabouts), and then hike back the next day, as it was only about 12km from there to the main camp.
  • Algonquin Provincial Park - I've only ever carcamped here, but there's a loo