Skip to content

Instantly share code, notes, and snippets.

View levibostian's full-sized avatar

Levi Bostian levibostian

View GitHub Profile
@levibostian
levibostian / Update-AUPacakges.md
Last active September 26, 2021 17:07
Update-AUPackages Report #powershell #chocolatey

.

@levibostian
levibostian / foo.yaml
Last active January 22, 2023 17:34
dropbox openapi spec
openapi: 3.0.0
info:
title: Dropbox API Reference
description: >+
The powerful, yet simple, Dropbox API allows you to manage and control
content and team settings programmatically and extend Dropbox capabilities
in new and powerful ways. This is a collection that includes requests to all
endpoints in the Dropbox API.
@levibostian
levibostian / Atomic.swift
Last active July 1, 2025 14:57
Swift Atomic property wrapper using DispatchQueue
import Foundation
/**
Guarantee the wrapped value is only ever accessed from one thread at a time.
Inspired from: https://github.com/RougeWare/Swift-Atomic/blob/master/Sources/Atomic/Atomic.swift
*/
@propertyWrapper
public struct Atomic<DataType: Any> {
fileprivate let exclusiveAccessQueue = DispatchQueue(label: "Atomic \(UUID())", qos: .userInteractive)
@levibostian
levibostian / DataBindingExtensions.kt
Last active August 29, 2025 19:51
android databinding ObservableBoolean to Kotlin Coroutine Flow
import androidx.databinding.Observable
import androidx.databinding.ObservableBoolean
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.distinctUntilChanged
/**
* Converts an ObservableBoolean to a Kotlin Flow.
*
@levibostian
levibostian / alternative.js
Last active November 2, 2025 13:29
tampermonkey github pull request mark file as Viewed keyboard shortcut. Found it in https://github.com/orgs/community/discussions/10197, but modified it over time because I found some bugs.
// ==UserScript==
// @name GitHub PR Review Mode Improvements. Credit: https://github.com/orgs/community/discussions/10197#discussioncomment-14710611
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically advances to next file after marking a file as viewed, outlines the active file, and focuses the "Viewed" checkbox for keyboard navigation
// @author You
// @match https://github.com/*
// ==/UserScript==
(function() {