Skip to content

Instantly share code, notes, and snippets.

@edew
edew / vimrc
Created April 6, 2024 18:07
vimrc
" Disable vi compatibility
set nocompatible
" Enable syntax highlighting
" See :help vimrc-filetype
filetype plugin indent on
" Ignore case in search strings
set ignorecase
@edew
edew / thenable.js
Created May 26, 2023 14:23
Thenable results
// For bonus points
// * ensure then/catch is always asynchronous
// * flatten f functions that return thenables
class Success {
constructor(v) {
this.v = v
}
then(f) {
@edew
edew / example.html
Last active December 21, 2022 15:36
Rescaling Canvas to Parent Element Size
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
html, body {
margin: 0;
width: 100%;
@edew
edew / how_to_provide_logs.md
Last active September 11, 2023 12:13
How to get Charting Library debug logs
  1. Enable debug mode
  2. Open the chart in your web browser and reproduce your issue. For example if you have an issue when adding a Moving Average indicator then add the indicator so the logs cover the issue you are reporting.
  3. Open the browser developer console and copy ALL of the output to a text file.
  4. Share that text file with us.

output

@edew
edew / Aliases.ps1
Last active December 28, 2020 11:40
PowerShell aliases I'm using as of December 2020
function g { git @args }
function ga { git add @args }
function gb { g branch @args }
function gst { g status @args }
function glg { g log --oneline --decorate -n 20 @args }
function gp { g push @args }
function gl { g pull @args }
function gpristine { g reset --hard; if ($?) { g clean -xdf } }
function grb { g rebase @args }
function gundo { g reset HEAD~ }
@edew
edew / snippet.json
Created June 25, 2020 13:16
Windows Terminal Git Bash snippet
{
"guid": "{5b8a040f-3688-43b9-90cd-2c956ca56063}",
"hidden": false,
"name": "Git Bash",
"commandline": "C:\\Program Files\\Git\\bin\\bash.exe -i -l",
"startingDirectory" : "%USERPROFILE%",
"icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico"
}
console.clear()
const OPEN_ROUND = '('
const CLOSE_ROUND = ')'
const OPEN_CURLY = '{'
const CLOSE_CURLY = '}'
const OPEN_SQUARE = '['
const CLOSE_SQUARE = ']'
@edew
edew / LruCache.js
Created June 6, 2020 10:08
LruCache doodle
console.clear()
class ListNode {
constructor(key, value) {
this.key = key
this.value = value
this.next = null
this.previous = null
}
@edew
edew / clone-plugins.sh
Last active March 30, 2020 14:39
My basic vimrc. Used with vim-polyglot, vim-prettier, vim-sensible, and vim-sleuth.
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
cd ~/.vim/bundle
git clone https://github.com/sheerun/vim-polyglot > /dev/null 2>&1
git clone https://github.com/prettier/vim-prettier > /dev/null 2>&1
git clone https://github.com/tpope/vim-sensible > /dev/null 2>&1
git clone https://github.com/tpope/vim-sleuth > /dev/null 2>&1
@edew
edew / aliases.sh
Created March 13, 2020 10:56
Shell aliases I'm using as of March 2020
-='cd -'
...=../..
....=../../..
.....=../../../..
......=../../../../..
1='cd -'
2='cd -2'
3='cd -3'
4='cd -4'
5='cd -5'