# Start a new feature
git checkout -b new-feature master
# Edit some files
git add <file>
git commit -m "Start a feature"
# Edit some files
git add <file>
git commit -m "Finish a feature"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// camelCase | |
// PascalCase | |
// snake_case | |
// kebab-case | |
function toCamel(string) { | |
return string.replace(/(^\w{1})|(\s{1}\w{1})/g, match => match.toUpperCase()).replace(/ /g, '').replace(/^\w/, c => c.toLowerCase()) | |
} | |
function toPascal(string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent | |
ssh-keygen -t ed25519 -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_ed25519 | |
# sudo apt-get install xclip | |
xclip -selection clipboard < ~/.ssh/id_ed25519.pub | |
# add key | |
# https://github.com/settings/keys |
If you ever need to download an entire website, perhaps for off-line viewing, wget can do the job — for example:
$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent www.website.org/tutorials/html/
This command downloads the website www.website.org/tutorials/html/.
The options are:
--recursive
: download the entire website--domains website.org
: don't follow links outside website.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
; | |
(async () => { | |
// get browserInfo | |
let nVer = navigator.appVersion; | |
let nAgt = navigator.userAgent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# shellcheck disable=SC1090,SC109,SC2001,SC1091,SC2086,SC2068 | |
# settings | |
UNRUNTIME_VERSION=1.0.13 | |
UNRUNTIME_URL=https://gist.githubusercontent.com/jasenmichael/f6214915c90b3e142ed165a6b9ac3f2f/raw/unruntime.sh | |
UNRUNTIME_DIR="$HOME/.unruntime" | |
NVM_INSTALL_URL=https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | |
BUN_INSTALL_URL=https://bun.sh/install |