Skip to content

Instantly share code, notes, and snippets.

View jzallas's full-sized avatar

Jon Zallas jzallas

View GitHub Profile
@jzallas
jzallas / check_update.sh
Last active July 21, 2024 21:41
Samsung check updates
#!/bin/bash
# Retrieve the list of packages
packages=$(adb shell pm list packages | sed 's/package://')
# Convert the packages to an array
IFS=$'\n' read -d '' -r -a package_array <<< "$packages"
total_packages=${#package_array[@]}
@jzallas
jzallas / debloat.js
Created July 20, 2024 20:21
Debloat z-fold6
const data = require('./definitions.json');
const definitions = data.reduce((acc, item) => {
const { id, ...others } = item
acc[item.id] = others
return acc
}, {})
const { exec } = require('child_process');
const util = require('util');
@jzallas
jzallas / captors.kt
Last active October 25, 2021 22:38
Using argument captors
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.mockito.kotlin.*
class RepositoryImplTest {
@Test
fun `without validating prefix`() {
// setup
val mockApi: Api = mock()
#!/bin/bash
# disables bloat packages on samsung devices
# tested with z fold 3
packages_to_uninstall=(
"com.microsoft.skydrive" \
"com.microsoft.office.excel" \
"com.microsoft.office.word" \
"com.microsoft.office.powerpoint" \
@jzallas
jzallas / Trie.kt
Created March 6, 2021 04:49
Basic Trie in kotlin
// because this keeps coming up in coding challenges and I hate solving this from scratch
class Node(
var word: String? = null,
val next: MutableList<Node?> = MutableList(26) { null }
)
// inserting
fun Node.insert(word: String) {
var current = this
#!/bin/bash
# disables bloat packages on samsung devices
# tested with z fold 2
packages_to_uninstall=(
"com.microsoft.skydrive" \
"com.microsoft.office.excel" \
"com.microsoft.office.word" \
"com.microsoft.office.powerpoint" \
@jzallas
jzallas / SchedulerExecutionTests.kt
Created October 9, 2018 03:16
Writing assertions against executing rxjava2 schedulers in kotlin
package com.example.test
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.Scheduler
import io.reactivex.disposables.Disposable
import io.reactivex.observers.TestObserver
import io.reactivex.schedulers.Schedulers
import io.reactivex.subjects.BehaviorSubject
import org.junit.Assert.*