Skip to content

Instantly share code, notes, and snippets.

View jeromecovington's full-sized avatar

Jerome Covington jeromecovington

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jeromecovington on github.
  • I am jeromecovington (https://keybase.io/jeromecovington) on keybase.
  • I have a public key ASC4pu-ETjvaaYvxasiq7rySsmD1x6032HnwvJq82pmWswo

To claim this, I am signing this object:

@jeromecovington
jeromecovington / tmux-in-brief.txt
Last active December 6, 2019 14:35
tmux in brief
tmux new-session -s my_session
tmux ls
tmux attach-session -t my_session
Ctrl+b c
Create a new window (with shell)
Ctrl+b w
Choose window from a list
Ctrl+b 0
Switch to window 0 (by number)
@jeromecovington
jeromecovington / nsolid-in-brief.md
Created February 14, 2020 21:40
Nsolid usage in brief

MacOS

  1. $ brew tap nodesource/nsolid
  2. $ brew install nsolid-console
  3. $ nsolid-console
  4. Run any script necessary to build app.
  5. $ NSOLID_APPNAME="my-app" NSOLID_COMMAND="localhost:9001" nsolid my-app/index.js
  6. Visit console at http://localhost:6753
  7. Start profiling in console.
  8. Exert load on local app at its usual port.
  9. Analyze and export results in console.
@jeromecovington
jeromecovington / vim-vscode-in-brief.txt
Last active September 14, 2020 16:45
vim + vscode in brief
"word" motions (no special chars)
w
forward by word
b
backward by word
e
end of word
ge
end of word (backward)
AWSTemplateFormatVersion: "version date"
" String
Description:
" template metadata
" arbitrary yaml
" CloudFormation helper scripts
" cfn-init, cfn-signal, cfn-get-metadata, cfn-hup
" Resources can have Metadata (install scripts, etc.)
Matchers
^
Match starting position
.
Match any single character, enclose in bracket for literal dot
a.c -> "abc", etc.
[a.c] -> "a", ".", "c"
[ ]
Match single character, or character within range
[abc], [a-c] -> "a", "b", "c"
type PartiallyRequired<T, K extends keyof T> = Pick<T, K> & Partial<T>;
type Test = {
foo: string;
bar: string;
baz: string;
};
type Test1 = PartiallyRequired<Test, "foo">;
@jeromecovington
jeromecovington / diff-redis-dumps.md
Created April 23, 2021 19:42
Save and diff Redis dumps
$ redis-cli --rdb dump-before.rdb save
$ redis-cli --rdb dump-after.rdb save
$ pip install rdbtools python-lzf
$ rdb --command diff dump-before.rdb | sort > sorted-dump-before.out
$ rdb --command diff dump-after.rdb | sort > sorted-dump-after.out
$ diff sorted-dump-before.out sorted-dump-after.out
@jeromecovington
jeromecovington / dynamic-fibonacci.js
Created June 8, 2021 20:35
Dynamic programming fibonacci example
// Naive recursion.
function fib1(n) {
if (n <= 1) {
return n
}
return fib1(n - 1) + fib1(n - 2)
}
{
console.log('fib1')

ALTER

ALTER TABLE table_name
ADD column_name datatype;

AND

SELECT column_name(s) 
FROM table_name