Skip to content

Instantly share code, notes, and snippets.

@petedoyle
petedoyle / SketchSystems.spec
Last active June 19, 2023 10:18 — forked from rgraves-aspiration/SketchSystems.spec
WIP Crypto App Logic
WIP Crypto App Logic
open app from home screen -> Has User Previously Logged In?
Logged Out Flow
Has User Previously Logged In?
yes -> Is Device Authentication Set Up?
no -> App Welcome Screen
App Welcome Screen
tap login -> Is Device Authentication Set Up?
git config --global alias.lg "log --all --graph --abbrev-commit --decorate --format='format:%m %C(dim white)%h%C(reset) - %C(#8854FB)%s%C(reset) %C(dim white)-%C(reset) %C(white)%an%C(reset) %C(dim white)(%ar)%C(reset)%C(auto)%d%C(reset)'"
@petedoyle
petedoyle / EdgeToEdge.kt
Last active March 10, 2022 09:59
Kotlin extension functions to simplify edge-to-edge on Android Q
/**
* Applies window transformation flags (WTFs) to aid in supporting
* edge-to-edge layouts on Android Q and higher.
*/
fun Activity?.applyEdgeToEdge(
lightStatusBar: Boolean = false,
lightNavigationBar: Boolean = false,
transparentStatusBar: Boolean = true,
immersive: Boolean = false
) {
@petedoyle
petedoyle / SystemWindowInsetExtensions.kt
Created June 15, 2019 02:22
Utilities for working with System Window Insets, based on Chris Banes' blog post: https://medium.com/androiddevelopers/windowinsets-listeners-to-layouts-8f9ccc8fa4d1
package com.amazon.phseven.common.app
import android.view.View
import android.view.ViewGroup
import android.view.WindowInsets
import androidx.core.view.updateLayoutParams
import androidx.databinding.BindingAdapter
import androidx.fragment.app.Fragment
/**

Keybase proof

I hereby claim:

  • I am petedoyle on github.
  • I am petedoyle (https://keybase.io/petedoyle) on keybase.
  • I have a public key ASDnlQUGk0BwbJ_ZxPl8_topt-WQUS1eKoNQm7IP6E_qewo

To claim this, I am signing this object:

@petedoyle
petedoyle / README.md
Last active June 21, 2018 18:51
GL-MT300N-V2 Wifi Toggle (IOT Testing)

GL-MT300N-V2 Automated Wifi Toggle for IOT Testing

Device setup (optional)

  1. Do whatever you'd normally do to set up a router- set the SSID, password, etc.

Script setup

  1. Plug in power to your device
  2. Connect your laptop or phone to the default SSID using the SSID/Password listed on the label on the back of the router.
  3. SSH to 192.168.8.1 as user root (default password is goodlife). For example, from Mac or Linux:
@petedoyle
petedoyle / gist:254f2f60c4c05334b1341379b488c757
Last active November 18, 2016 21:49
JIRA Release notes script (formatted for Slack)
var output = "\n";
$('tr.issuerow').each(function(index) {
issuerow = $(this);
var key = issuerow.find('td.issuekey a.issue-link').data().issueKey;
var summary = issuerow.find('td.summary a.issue-link').text();
var type = issuerow.find('td.issuetype img').attr('alt');
output += "* " + key + " " + summary + "\n";
});
@petedoyle
petedoyle / build_speeds_specific_changes.md
Last active July 7, 2016 19:33
Specific changes used for the build speed benchmarks

Change one line of code

For the code change tests, this is the line of code I added/removed between tests: DogMarkerOptions.java:

    public DogMarker getMarker() {
        marker.setDogId(dogId);
        marker.setPosition(position);
//        marker.setSnippet(snippet); // snippet is not overrideable in base class Marker
//        marker.setTitle(title); // title is not overrideable in base class Marker
        marker.setIcon(icon);
@petedoyle
petedoyle / gist:4129668
Last active January 29, 2021 08:19
Notes: OpenWRT / Codel on TL-WDR4300

Overview

I'm tired of massive delay (500-1000 ms pings) while uploading large files. QoS helps some, but a significant portion remains due to bufferbloat (100-150ms). This leads to delay in VoIP calls and generally sluggish web browsing while uploading.

The new Codel algorithm in OpenWRT / Attitude Adjustment should help a lot. The results below show only ~5-6ms of added latency during uploads (i.e. 14ms vs 500+ms before!). Insane.

These instructions are for the TP-Link TL-WDR4300, because I got a good deal. If you have the money, buy a Netgear WNDR3800 and install CeroWRT, you'll probably see even better results.

Why the TP-Link TL-WDR4300

In short, its fully supported in OpenWRT Attitude Adjustment and works well for my needs:

  • Cheap
# http://localhost:8080/v1/solution?solutionCategoryId=4942
select
this_.id as id3_1_,
this_.version as version3_1_,
this_.date_created as date3_3_1_,
this_.description as descript4_3_1_,
this_.import_source as import5_3_1_,
this_.import_source_collection_url as import6_3_1_,
this_.import_source_url as import7_3_1_,
this_.keywords as keywords3_1_,