Skip to content

Instantly share code, notes, and snippets.

View tylergannon's full-sized avatar

Tyler Gannon tylergannon

  • Ciudad de Colon, Costa Rica
  • 02:35 (UTC -06:00)
View GitHub Profile
@tylergannon
tylergannon / graph.svg
Created February 24, 2026 21:22
cat-monitor-user-story-generator-with-models
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tylergannon
tylergannon / user-story-generator.svg
Created February 24, 2026 21:16
cat-monitor-user-story-generator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tylergannon
tylergannon / $lib-server-mongoose-index.ts
Last active June 25, 2024 03:14
Avoiding OverwriteModelError while developing with mongoose and Svelte Kit (vite) dev server
/**
* @fileoverview Exports all models and mongoose instance
* @author @tylergannon
*
* Note the conditional creation of new models. This is to prevent
* conflict during development, between the HMR process repeating the
* same calls to mongoose.model(), which is not idempotent but throws
* an error if the model already exists.
*/
import type { Model } from 'mongoose';
@tylergannon
tylergannon / Instructions.md
Created February 16, 2023 14:49
Building Python C extensions on macOS

Setting up and building a Python C extension project on macOS

These instructions were developed for a project using vscode on macOS 13.0.1.

Install needed software

If you haven't already, you'll need an updated xcode command-line tools. Do this by running xcode-select --install or by going to https://developer.apple.com and downloading the XCode command line tools. I wound up with version 14.2.

cmake

@tylergannon
tylergannon / JvmTest.kt
Last active May 8, 2022 23:34
Kotlin multiplatform with compose tests
class ModelContainerHostTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test fun firstTest() = runBlocking {
composeTestRule.setContent {
@Composable fun doAThing() = 1
doAThing() shouldBeExactly 2
}
@tylergannon
tylergannon / vim.md
Last active August 1, 2019 09:51
vim cheat sheet
@tylergannon
tylergannon / RBTree.rs
Last active November 25, 2025 17:55
Red Black Tree written in Rust
#![allow(dead_code)]
extern crate rand;
use std::cmp::Ord;
use std::cmp::Ordering;
use std::fmt::Debug;
use std::iter::Iterator;
use std::iter::IntoIterator;
use rand::Rng;
@tylergannon
tylergannon / GreaterThanBST.kt
Last active March 22, 2019 05:51
Kotlin Red Black Tree. For a programming challenge. Instead of a key-value store, it returns the number of items added, whose value is greater than than the given key.
class GreaterThanBST {
private var root : Node? = null
fun add(key : Int) {
root = put(root, key)
}
operator fun get(key : Int) : Int = get(root, key)
@tylergannon
tylergannon / Install-BaseComponents.ps1
Last active June 23, 2018 00:28
Install base components for Kubo
& {
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if (-not $IsAdmin)
{
Write-Host -ForegroundColor Yellow "This needs to be run as administrator."
Write-Host -ForegroundColor Yellow "Please open a new powershell as administrator, and try again."
exit 2
@tylergannon
tylergannon / Install-SingleApp.ps1
Last active June 22, 2018 23:19
Configure Git, Download Repository, Start Kubo inside of project.
# Command to run:
# $file = [System.IO.Path]::GetTempFileName(); (New-Object System.Net.WebClient).DownloadString('https://kubobuild.page.link/rniX') | Out-File -FilePath "${file}.ps1"; . "${file}.ps1"
& {
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)
if ($IsAdmin)
{
Write-Host -ForegroundColor Yellow "This should not be run as administrator."