Skip to content

Instantly share code, notes, and snippets.

View jasenmichael's full-sized avatar

Jasen Michael jasenmichael

View GitHub Profile
@jasenmichael
jasenmichael / vite.config.ts.md
Created January 5, 2024 18:42
Folder as entry in library mode for multiple independent js modules
./src/
  src/cli.ts
  src/index.ts
./vite.config.ts

vite.config.ts

import { resolve } from "node:path"
@jasenmichael
jasenmichael / popos-get-docker.sh
Last active November 5, 2023 01:08
quickly install docker for pop_os (tested on 20.04)
#! /bin/bash
if [[ -z $1 ]] || [[ "$1" != "-r" ]] && [[ "$1" != "--reinstall" ]]; then
type docker >/dev/null 2>&1 && echo "Docker already installed, exiting" && exit 0
fi
echo "Installing Docker..."
sleep 2
# from the docker website - Install Docker Engine on Ubuntu
@jasenmichael
jasenmichael / boat.sh
Last active November 29, 2022 13:41
run docker container, mount local volume, and open terminal.
#!/bin/bash
type docker >/dev/null 2>&1 || { echo "Docker could not be found"; exit 1; }
function usage()
{
cat << EOF
Usage: $progname [--port NUM] [--dir STR] [--image STR]
optional arguments:
#!/bin/bash
## installs node 16.x
## install with:
## curl -fsSL https://tinyurl.com/install-node-16-pop-os | sudo -E bash -
sudo rm /etc/apt/sources.list.d/nodesource.list
sudo apt --fix-broken install
sudo apt update

this is a likely folder structure:

/docs/ << all dirs in docs are added as categories
  ./[category]/
    ./[section]/   << all dirs in category are added as category sections
      ./[article].md  << all .md files in section are added as section articles

EXAMPLE:

@jasenmichael
jasenmichael / repo-reset.md
Created March 24, 2022 14:55 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h1>yo</h1>
@jasenmichael
jasenmichael / commit-message-format.md
Last active February 11, 2022 02:39
Simple Git Commit Message Format

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

git commit -m "<type>: <subject>"

The header is mandatory and the scope of the header is optional.

@jasenmichael
jasenmichael / recursivly-convert-html-markdown.js
Last active January 11, 2022 02:59
recursivly convert html to markdown using nodejs
const fs = require("fs");
const path = require("path");
const glob = require("glob");
const TurndownService = require("turndown");
const turndownService = new TurndownService({
// options
headingStyle: "atx",
bulletListMarker: "-",
linkStyle: "referenced",
@jasenmichael
jasenmichael / ssh-list.sh
Last active January 5, 2022 00:00
ssh-list.sh
#!/bin/bash
usage() {
cat <<EOM
Usage:
$(basename $0) '[remotes]' '[command]'
example:
$(basename $0) 'ELIT ASHC' 'cd /var/www/html && pwd'
EOM