Skip to content

Instantly share code, notes, and snippets.

View tylergannon's full-sized avatar

Tyler Gannon tylergannon

  • Ciudad de Colon, Costa Rica
  • 00:19 (UTC -06:00)
View GitHub Profile
@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 / $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';