Skip to content

Instantly share code, notes, and snippets.


Nathaniel nathanielks

View GitHub Profile
frank-dspeed / get-es-path.mjs
Created January 23, 2020 09:54
Method to get Current File Path inside ESM
View get-es-path.mjs
function getPath(url) {
let result = new URL(import.meta.url)
let pathname = result.pathname
let pathArray = pathname.split('/')
let basename = pathArray.pop()
let dirname = pathArray.join('/')
return { pathname, dirname,basename}
webframp /
Created July 25, 2017 18:14
Signing git commits on github using gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: and Ensure the keybase cli is in your PATH

First get the public key

keybase pgp export | gpg --import

Next get the private key

euank / Dockerfile
Last active March 14, 2023 23:40
ECS / EC2 Metadata entrypoint example
View Dockerfile
FROM golang:1.4
COPY main.go main.go
RUN go build -o main main.go
RUN chmod +x /
CMD ["./main"]
acdvorak /
Last active August 6, 2021 17:09 — forked from yubink/
tmux: run a command in all panes
# Runs the specified command (provided by the first argument) in all tmux panes
# in every window. If an application is currently running in a given pane
# (e.g., vim), it is suspended and then resumed so the command can be run.
all-panes-bg_ "$1" &
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
Rarst / r-debug.php
Last active March 16, 2023 13:28
R Debug (set of dump helpers for debug)
View r-debug.php
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI:
License: MIT