Skip to content

Instantly share code, notes, and snippets.

View levibostian's full-sized avatar

Levi Bostian levibostian

View GitHub Profile
@levibostian
levibostian / script.js
Created September 9, 2025 14:15
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 keyboard shortcut
// @version 0.3
// @description Mark file as "viewed" on GitHub PR UI when hovering and pressing 'Escape' key
// @match https://github.com/*
// @author dvdvdmt, nbolton
// @source https://github.com/orgs/community/discussions/10197
// ==/UserScript==
(function() {
@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 / 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 / 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 / Update-AUPacakges.md
Last active September 26, 2021 17:07
Update-AUPackages Report #powershell #chocolatey

.

@levibostian
levibostian / readme.md
Last active August 29, 2022 19:00
gaming PC windows setup

OS

Use Rufus to create bootable USB. You can download Windows ISO from Rufus. Or, use AtlasOS(Install on a USB).

  • Boot into USB and install Windows!

After first boot up

  • open this webpage. It will help to walk you through everything.
  • Install chocolatey
  • Install firefox choco install -y firefox
@levibostian
levibostian / README.md
Created June 16, 2021 14:15
launch Android library/SDK to maven central

Is your project able to be on Maven Central?

There are requirements in order to be published on Maven Central. If your project is not open source, for example, you cannot be on Maven Central.

Manually apply to get access to Sonatype servers

When you publish Android library files, you do it under a group id. You decide what this group id should be. You could pick your reverse domain name if you own a domain name: com.levibostian. This method requires you verify you own the domain name. You can also just use a github domain name where all you have to do is verify your github repo and your groupId is something like io.github.yourusername.

You must use Sonatype's Jira system in order to reserve your groupId. Here is a full example of the issue template you can use and the communication back and forth through the entire process. ([Official docs on using Jira](https:/

@levibostian
levibostian / app_build.gradle
Created June 14, 2021 18:02
Install Android SDK from private github repo in your Android app
// this file is in app/build.gradle
...
dependencies {
// Install your library
implementation 'com.example.lib:sdk:0.1.1-alpha'
}
@levibostian
levibostian / README.md
Created November 13, 2020 16:10
Install windows on a mac

Installing Windows on an Intel Mac is pretty easy, but there can be many issues using Bootcamp (Apple's official software used to help you install Windows).

My buddy wanted to install Windows on their MacBook Pro but they had an older version of macOS installed. This meant that their version of Bootcamp was also older. Well, Windows gets updated all the time and Bootcamp needs to be updated to keep up with these changes. Also while we were doing this, I found tons of comments online of people also having various issues using Bootcamp so I knew I was not the only one who has had issues no matter the version of macOS I was using.

To fix the problem we did it the manual way. Not using Bootcamp much at all. It worked!

To figure this out, I used this guide for some inspiration but it sure did not do it all for me.

  • Get a flash drive to install Windows on. Boot into macOS on your mac.
  • Format the flash drive to exFAT. Not FAT32. This is because FAT32 can onl
@levibostian
levibostian / AppCoreDataManager.swift
Last active January 25, 2025 07:44
iOS CoreData ultimate document. Stack, tutorial, errors could encounter. All my CoreData experience for what works in 1 document.
import CoreData
import Foundation
protocol CoreDataManager {
var uiContext: NSManagedObjectContext { get }
func newBackgroundContext() -> NSManagedObjectContext
func performBackgroundTaskOnUI(_ block: @escaping (NSManagedObjectContext) -> Void)
func performBackgroundTask(_ block: @escaping (NSManagedObjectContext) -> Void)
func loadStore(completionHandler: ((Error?) -> Void)?)
}