Skip to content

Instantly share code, notes, and snippets.

View jeffypooo's full-sized avatar
🔥

Jefferson Jones jeffypooo

🔥
View GitHub Profile
@jeffypooo
jeffypooo / adbwifi.sh
Last active September 25, 2019 16:25 — forked from stormzhang/adbwifi.sh
shell script for adb wifi
#!/bin/bash
REGEX_DEV_TCPIP="192\.168\.[0-9].*"
REGEX_INET_IP_1="inet (192\.168\.[0-9]\.[0-9]{1,3})"
REGEX_INET_IP_2="[0-9\.]+"
#List the devices on the screen for your viewing pleasure
echo "listing devices..."
adb devices
echo
@jeffypooo
jeffypooo / install_app_bundle.sh
Created April 24, 2019 20:50
Bash functions for installing an android app bundle (.aab) onto a device
# NOTE: these functions assume ANDROID_HOME/tools/bin is in your PATH
buildapks() {
bundletool build-apks --bundle=${1} --output=${2}
}
installapks() {
bundletool install-apks --apks=${1}
}
@jeffypooo
jeffypooo / max-heap-example.kt
Created March 31, 2019 03:18
Kotlin max heap example
data class Worker(
val quality: Int,
val wage: Int,
val ratio: Double = wage.toDouble() / quality.toDouble()
)
class MaxHeap(private var capacity: Int = 32) {
private var array = arrayOfNulls<Worker>(capacity)
var size = 0
@jeffypooo
jeffypooo / KL43Z.s
Created March 1, 2019 00:10
KL43Z Startup code
.syntax unified
.arch armv6-m
.section .isr_vector, "a"
.align 2
.globl __isr_vector
__isr_vector:
.long __StackTop /* Top of Stack */
.long Reset_Handler /* Reset Handler */
.long NMI_Handler /* NMI Handler*/
@jeffypooo
jeffypooo / Verifications.kt
Created February 15, 2019 19:54
mockito_kotlin verfiy extensions (similar to stub)
import org.mockito.verification.VerificationMode
inline fun <T : Any> T.verify(verification: KVerification<T>.(T) -> Unit) = this.apply {
KVerification(this).verification(this)
}
class KVerification<out T>(private val mock: T) {
fun <R> invoked(mode: VerificationMode? = null, methodCall: T.() -> R): R {
return if (null != mode) {
@jeffypooo
jeffypooo / # libftdi - 2018-07-01_20-10-12.txt
Created July 2, 2018 03:10
libftdi on macOS 10.14 - Homebrew build logs
Homebrew build logs for libftdi on macOS 10.14
Build date: 2018-07-01 20:10:12
@jeffypooo
jeffypooo / # libftdi - 2018-07-01_19-48-01.txt
Created July 2, 2018 02:49
libftdi (libftdi) on macOS 10.14 - Homebrew build logs
Homebrew build logs for libftdi on macOS 10.14
Build date: 2018-07-01 19:48:01
@jeffypooo
jeffypooo / # libftdi - 2018-07-01_19-32-06.txt
Created July 2, 2018 02:32
libftdi (libftdi) on macOS 10.14 - Homebrew build logs
Homebrew build logs for libftdi on macOS 10.14
Build date: 2018-07-01 19:32:06
@jeffypooo
jeffypooo / # libtool - 2018-07-01_18-32-45.txt
Created July 2, 2018 01:36
libtool on macOS 10.14 - Homebrew build logs
Homebrew build logs for libtool on macOS 10.14
Build date: 2018-07-01 18:32:45
@jeffypooo
jeffypooo / Binary.swift
Created May 20, 2018 03:52
Generic serialization utility for Swift
//
// Binary.swift
//
// Created by Jefferson Jones on 2/14/17.
// Copyright © 2017 Jefferson Jones. All rights reserved.
//
import Foundation
class Binary {