Skip to content

Instantly share code, notes, and snippets.

@dewdad
dewdad / generate-ssh-key.sh
Created May 12, 2020 08:35 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@dewdad
dewdad / README.md
Last active September 23, 2019 13:25
SVG Sprite in Vue CLI projects
#################
# Initial Setup #
#################
#The command to run, built from the raw link of this gist
#START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/dewdad/56f9818c123ad984afbcfba90eb18359/raw/1d094bd48f488085807babd71456db9794e64ea9/RegUserBoxstarter.ps1
#As described here: http://boxstarter.org/Learn/WebLauncher
#########################################
@dewdad
dewdad / monorepo-tool-comparison.md
Created August 8, 2019 07:35 — forked from morewry/monorepo-tool-comparison.md
Comparison of Monorepo Tools For Web Client / Front End Projects (That Probably Use HTML, CSS, and JS)

Mono Repository Tool Comparison

For Web Client / Front End Projects

(That Probably Use HTML, CSS, and JS)

I made a list of 20 things I might want out of a monorepo tool for a Design System to use as a basis for comparing some of the options including Lerna, Northbrook, and Rush.

⚠️ Northbrook's author says the project is pretty dead and now uses Lerna.

Qualifications Wanted

@dewdad
dewdad / How I migrated from multi-repository to mono-repository in one day.html
Last active August 5, 2019 06:22
How I migrated from multi-repository to mono-repository in one day
How I migrated from multi-repository to mono-repository in one day
We had a lot of repositories for different services. There are 20K+ commits in 15+ repositories. Each repository has its own Dockerfile, tests, lint rules, etc.
Turns out, it’s hard to maintain, especially when you have dependent repositories across. I.e. you have repository api that is using a package from another repository, let’s say commons. If you publish an update in commons, you need to go through all the dependent repositories and update commons there.
Now, just imagine how long it takes, to make a clone of each repository, make an update there and push changes back to remote. It’s hard to say for me, but these kinds of updates were leading to half a day work just for updating the changes in other repositories. Therefore, we allocated resources for changing that.
But, before I started migration to a mono repository, I spent some time investigating the pros and cons of other alternatives.
@dewdad
dewdad / es6-element-ready.js
Created July 14, 2019 20:14 — forked from jwilson8767/es6-element-ready.js
Wait for an element to exist. ES6, Promise, MutationObserver
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/
export function elementReady(selector) {
return new Promise((resolve, reject) => {
let el = document.querySelector(selector);
@dewdad
dewdad / FiddlerScript.js
Created July 14, 2019 19:39
FiddlerScript
import System;
import System.Windows.Forms;
import Fiddler;
// INTRODUCTION
//
// Well, hello there!
//
// Don't be scared! :-)
//
@dewdad
dewdad / watch vuex deep state changes.js
Created June 19, 2019 11:50
Watch nested data from vuex store state
computed:{
storeInvalidated: get('view/invalidateStore')
},
watch: {
'storeInvalidated.meetings': {
handler(newVal, oldVal) {
if (newVal && newVal !== oldVal) {
logger.debug('meetingsInvalidated', { newVal, oldVal });
// this.initializeMeetings();
}
@dewdad
dewdad / get element edge nearest to y.js
Created June 19, 2019 10:57
Finding element intersection and position in DOM
/**
* This function is useful for getting first and last elements inside a container given a y offset such as top and bottom of visible area.
* One way to mark the top and bottom of a container is to add 2 markers divs like so
* <section class="container">
* <div class="fixed-top-marker" style="position: fixed; top: 0" />
* ...
* <div class="fixed-bottom-marker" style="position: fixed; bottom: 0" />
* </section>
*
* then to query bottom use:
@dewdad
dewdad / vsCodeGitMac.txt
Created June 3, 2019 07:04 — forked from jackhickey/vsCodeGitMac.txt
Enabled vscode as your git editor on mac
# Inside of vscode open the command pallete and run '>shell command install code in path' or something along those lines...
git config --global core.editor "code --wait"
git config --global -e
(add the lines below inside in the git config...)