Skip to content

Instantly share code, notes, and snippets.

View haydenbbickerton's full-sized avatar

Hayden Bickerton haydenbbickerton

  • 16:06 (UTC -05:00)
View GitHub Profile
@cometkim
cometkim / node-pm-globals.md
Last active June 4, 2024 12:52
How package managers dealing with binaries from transitive dependencies
$pm add vite

# should be success
$pm run vite --version

# shoud be fail
$pm run esbuild --version
I faced this issue with the following environment:
iPhoneX iOS 16.5.1, palera1n rootless jb, ellekit 1.0
@cau777
cau777 / pnpm-overrides-fix.ts
Last active February 6, 2024 00:31
Simple TS script that reads patches from `pnpm audit` and manually applies them to package.json overrides, so that `pnpm` recognizes them properly. Meant to be used with `ts-node`
import { readFileSync, writeFileSync } from 'fs'
import semver from 'semver'
import { exec } from 'child_process'
// Currently, pnpm (version 8.5.1) is not recognizing overrides properly on install
// This is a temporary solution that simplifies the overrides generated by pnpm audit -P --json
// It basically gets rid of the vulnerable version specifier
interface SimplifiedPackageConfig {
pnpm?: {
@tito
tito / refactor.py
Created March 8, 2023 16:51
Using OpenAI/ChatGPT as refactoring tool
"""
Refactoring tool using ChatGPT from Vue 2 to Vue 3
$ export OPENAPI_APIKEY=sk.........
$ python refactor.py MyView.vue
"""
import os
import re
import sys
@mgd216
mgd216 / vue_nuxt_vuetify_migration.md
Last active May 7, 2024 14:00
Vue2 / Vuetify2 Migration to Vue3 / Nuxt3 / Vuetify3

Vue3 / Nuxt3 / Vuetify3 Migration Steps

  • The following notes are a 'checklist' for migrating a large Vue2 / Vuetify2 project to Vue3 / Nuxt3 / Vuetify3. It is NOT intended to be a step-by-step migration guide, they are rough notes our team used for migration
  • Our team decided to create a brand new Nuxt3 app, instead of tyring a 'bridge' or running Vue2/Vue3 side-by-side:
    • nuxi init our-new-app-v3
  • We also changed our store from Vuex to Pinia
  • We decided to use the experimental @vue/reactivity-transform. This provides the ability to use a ref in the script block without having to use .value everywhere
    • without reactivity-transform
      • let userName = ref<string>('')
      • userName.value = "John Doe"
  • with reactivity-transform
@Uninen
Uninen / main.rs
Created September 28, 2022 12:30
Tauri implementation for titleBarStyle: 'hidden'
// See https://github.com/Uninen/tauri-vue-template for more info
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use cocoa::appkit::{NSWindow, NSWindowStyleMask, NSWindowTitleVisibility};
use tauri::api::shell;
use tauri::{CustomMenuItem, Manager, Menu, Runtime, Submenu, Window, WindowEvent};
@getify
getify / 1-CalendarItem.js
Last active March 21, 2024 09:11
an illustration (non-trivial example) of many newer JS class features
// abstract class, not intended to be instantiated directly
class CalendarItem {
static #UNSET = Symbol("unset")
static #isUnset(v) {
return v === this.#UNSET;
}
static {
for (let [idx,msg] of [
"ID is already set.",
"ID is unset.",
@cometkim
cometkim / index.mjs
Created March 25, 2022 16:55
Search all packages that doesn't support ESM from node_modules directory
import * as path from 'node:path';
import * as fs from 'node:fs/promises';
const nodeModules = path.resolve('node_modules');
let moduleNames = await fs.readdir(nodeModules);
moduleNames = (await Promise.all(
moduleNames.map(async name => {
if (name.startsWith('.')) {
return [];
#!/usr/bin/env python
__author__ = 'surister'
__author_contact__ = 'github/surister'
import pathlib
import sys
if len(sys.argv) < 2:
raise Exception('Expected one argument with ".../project/node_modules/@vue/" path')
@nicknisi
nicknisi / new-worktree.sh
Created January 27, 2022 12:44
Create a new worktree, install dependencies, and run an initial build
#!/usr/bin/env bash
# This script should help facilitate setting up a new worktree, including:
# - creating a new worktree
# - installing dependencies
# - creating a new branch
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT