Skip to content

Instantly share code, notes, and snippets.

View josh-hemphill's full-sized avatar

Josh josh-hemphill

View GitHub Profile
@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
@josh-hemphill
josh-hemphill / v2.4.1.json
Last active May 25, 2021 18:38
Caddy Json Schema for VSCode
{
"title": "Caddy v2 autogenerated JSON schema \nhttps://github.com/abiosoft/caddy-json-schema",
"description": ": object\nhttps://pkg.go.dev/github.com/caddyserver/caddy/v2#Config\nConfig is the top (or beginning) of the Caddy configuration structure.\nCaddy config is expressed natively as a JSON document. If you prefer\nnot to work with JSON directly, there are [many config adapters](/docs/config-adapters)\navailable that can convert various inputs into Caddy JSON.\n\nMany parts of this config are extensible through the use of Caddy modules.\nFields which have a json.RawMessage type and which appear as dots (•••) in\nthe online docs can be fulfilled by modules in a certain module\nnamespace. The docs show which modules can be used in a given place.\n\nWhenever a module is used, its name must be given either inline as part of\nthe module, or as the key to the module's value. The docs will make it clear\nwhich to use.\n\nGenerally, all config settings are optional, as it is Caddy convention to\nhave good
@josh-hemphill
josh-hemphill / toAnchor.js
Last active March 4, 2021 17:52
Create GitHub/GitLab anchor link from header text
function toAnchor(...text) {
let temp = text.join('').toLowerCase();
temp = temp.replace(/[^\w ]+/g,'');
temp = temp.replace(/ +/g,'-');
return '#' + temp;
}
const t = toAnchor;
#!/bin/bash
read -p "Install LF for Ubuntu20.04? [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Nn]$ ]]
then
echo 'deb http://download.opensuse.org/repositories/home:/Provessor/xUbuntu_20.04/' | sudo tee /etc/apt/sources.list.d/home:Provessor.list
wget -q -nv -O - https://download.opensuse.org/repositories/home:Provessor/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_Provessor.gpg > /dev/null
sudo apt update
sudo apt install lf
fi
@josh-hemphill
josh-hemphill / npmSec
Created October 9, 2020 17:20
NPM Security totals by depth0 package
#!/usr/bin/env node
'use strict';
const {execSync} = require('child_process');
let result = {};
try {
result = execSync(`npm audit --json --long`);
} catch (error) {
const {stdout, stderr} = error;
result = {stdout, stderr};
}