Skip to content

Instantly share code, notes, and snippets.

View levibostian's full-sized avatar

Levi Bostian levibostian

View GitHub Profile
@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 October 6, 2023 18:02
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)?)
}
@levibostian
levibostian / README.md
Last active August 13, 2023 06:07
Beginner guide to conventional commits.

You know that when you are writing code and you make a git commit to your code? You know that when you make a commit, you are asked to type a message for that commit, right?

Conventional commits are a set of rules to follow for what to type for your commit messages. For example, let's say that you add a new feature to your latest app where users can upload a photo for their profile. Instead of writing a commit message like this: Add feature so users can upload profile picture for profile, you would write a commit message like this: feat(profile): user can upload profile picture. Notice that when you read both messages, they both mean the same thing. However, they are written in 2 different formats. When you write your commit message in the later format, we call that a Conventional commit.

Why?

Conventional commits are becoming more popular today and for good reason. Conventional commits are not only more descriptive to read, but they are written in a format that a computer can understand better

@levibostian
levibostian / TableViewExtensions.swift
Created June 22, 2020 18:56
Swift show/hide loading indicator at the bottom of the list. Great for paging.
import UIKit
extension UITableView {
func showLoadingFooter() {
let spinner = UIActivityIndicatorView(style: .gray)
spinner.startAnimating()
spinner.frame = CGRect(x: CGFloat(0), y: CGFloat(0), width: self.bounds.width, height: CGFloat(44))
self.tableFooterView = spinner
self.tableFooterView?.isHidden = false
@levibostian
levibostian / loop.sh
Last active April 20, 2020 16:28
CLI to run command until success, or timeout.
#!/bin/bash
# Script that executes a command until it succeeds or timesout.
# Usage: `./bin/loop.sh command-here`
# You can override the default parts of the script by:
# `SLEEP_TIME=1 MAX_TRIES=2 ./bin/loop.sh command-here`
#
# The script will send STDOUT message giving you an update on how things are going. The exit code of the command will be successful or failed depending on if the command succeeded before the timeout.
# Thanks, https://stackoverflow.com/a/12321815/1486374