Skip to content

Instantly share code, notes, and snippets.

View josh-hemphill's full-sized avatar

Jo josh-hemphill

View GitHub Profile
@josh-hemphill
josh-hemphill / try_codemod.ts
Created December 18, 2025 05:59
Codemods for auto-transforming rust interfaces for NAPI-RS
import { $ } from 'dax-sh';
import toml from '@ast-grep/lang-toml';
import rust from '@ast-grep/lang-rust';
import type { Edit, SgNode } from '@ast-grep/napi';
import type { Kinds, TypesMap } from '@ast-grep/napi/types/staticTypes';
import { parseAsync, registerDynamicLanguage } from '@ast-grep/napi';
import glob from 'fast-glob';
import { assert } from 'vitest';
import { parse as yamlParse } from 'yaml';
const globStream = glob.stream;
@josh-hemphill
josh-hemphill / cockpit.desktop
Last active May 4, 2025 15:10
Cockpit Desktop .desktop file
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Cockpit Local
MimeType=x-scheme-handler/ssh
Exec=/usr/libexec/cockpit-desktop / %u
Icon=/usr/share/cockpit/branding/default/apple-touch-icon.png
StartupWMClass=cockpit-client
@josh-hemphill
josh-hemphill / pymod.mts
Created March 18, 2025 05:35
Provision raspberry pi with log2ram etc
/// <reference types="E:\\Share\\dev\\pnpm\\node_modules\\@types\\node" />
import { access, copyFile, mkdir, readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { createInterface } from 'node:readline';
import { createWriteStream } from 'node:fs';
const DRIVE_LETTER = 'F:';
// Check for --u6143 flag to bypass prompt
const isU6143 = process.argv.includes('--u6143');
@josh-hemphill
josh-hemphill / .p10k.zsh
Last active November 5, 2024 23:42
PowerLevel10k config
# Generated by Powerlevel10k configuration wizard on 2024-09-04 at 21:43 PDT.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 04242.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 2 lines, solid, full frame, lightest-ornaments, compact, many icons, concise,
# transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@josh-hemphill
josh-hemphill / exportService.hbs
Created September 29, 2023 05:29
Template (handlebars) files for creating vue `useFetch` bindings in openapi-typescript-codegen
import { type UseFetchOptions, useFetch } from 'src/vue/useFetchPolyfill.js';
import type { MaybeRefOrGetter } from '@vueuse/shared';
import { toValue } from '@vueuse/shared';
import { getRequestBody } from 'src/core/getRequestBody.js';
import { mergeHeaders } from 'src/core/mergeHeaders.js';
import { getHeaders } from 'src/core/utils.js';
import { getUrl } from 'src/core/getUrl.js';
{{#if imports}}
@josh-hemphill
josh-hemphill / !WingetCollections.txt
Last active January 25, 2022 03:23
winget software
create
dev
diagnostics
gaming
init
office
@josh-hemphill
josh-hemphill / zip-extensions.js
Created November 2, 2021 01:17
node zip files
// require modules
const fs = require('fs')
const path = require('path')
const archiver = require('archiver')
const IS_CI = !!(process.env.CIRCLECI || process.env.GITHUB_ACTIONS)
const ProgressBar = !IS_CI ? require('progress') : {}
const readDirGlob = !IS_CI ? require('readdir-glob') : {}
const INCLUDE_GLOBS = [
'build/**',
import { parse } from "https://deno.land/std@0.112.0/flags/mod.ts";
const HELP_TEXT = `
usage: this-file <steam username> <target steam library directory> [--no-verify]
usage (as script): deno run -A ./update-verify.ts <steam username> <target steam library directory> [--no-verify]
You can alternatively specify <username> and <library> with any alias. e.g.
-u <username>
--user <username>
--username <username>
--user=<username>
{
"prettier.enable": false,
"typescript.preferences.importModuleSpecifierEnding": "js",
"workbench.editor.tabSizing": "fit",
"workbench.editor.decorations.colors": true,
"workbench.editor.wrapTabs": true,
"synthwave84.disableGlow": true,
"scm.alwaysShowActions": true,
"scm.alwaysShowRepositories": true,
"editor.suggestSelection": "first",
@josh-hemphill
josh-hemphill / example.md
Created June 10, 2021 15:01
VSCode launch to ssh remote
code --folder-uri "vscode-remote://ssh-remote+remote_server_goes_here/folder/on/remote/host/here