Skip to content

Instantly share code, notes, and snippets.

View median-man's full-sized avatar

John Desrosiers median-man

  • El Cajon, CA USA
View GitHub Profile
@median-man
median-man / README.md
Last active September 2, 2022 13:37
safe_url_angular

Angular style url "whitelist" pattern. I found this snippet while reading Preventing XSS in React. The snippet is sournced from Angular which has an "MIT style" license.

@median-man
median-man / bash_snippets.md
Last active July 28, 2022 18:53
A collection of useful command line snippets for managing the bootcamp repos.

Find Folders and Run a command from each folder

The following command searching for folders named client within the pwd traversing to a max depth of 2. Then it executes npm i react-scripts@latest in each found directory.

find . -maxdepth 2 -type d -name client -exec bash -c "cd '{}' && npm i react-scripts@latest" \;

Use the following command to print the directories before excuting a command with the following:

find . -maxdepth 2 -type d -name client -exec bash -c "cd '{}' && pwd" \;

@median-man
median-man / README.md
Created November 10, 2021 22:34
Demo Gist

Demo Gist

Just my little test. Hello, World!

bierner.markdown-preview-github-styles
dbaeumer.vscode-eslint
esbenp.prettier-vscode
ms-vscode-remote.remote-wsl
streetsidesoftware.code-spell-checker
techer.open-in-browser
yzhang.markdown-all-in-one
@median-man
median-man / ssh-setup.md
Last active August 27, 2020 13:34
Setting up SSH for Git VC
@median-man
median-man / windows.md
Last active April 7, 2020 12:00
Helpful Commands

Helpful Windows Commands

Find and Kill Process by Port

  1. Find the process id(s) listening to the port netstat -ano | findstr <port>
  2. Kill process for given process id (pid) taskkill -F -PID <pid> *
  • Replace - with / in CMD terminal.
@median-man
median-man / README.md
Last active February 25, 2020 14:39
basic app shell

This is a simple app shell for a PWA. It includes a navbar, two "screens" or "pages", and inlined styles to create a horizontal scrolling effect that snaps to each screen. A loader is also included. Each page initially renders a loader.

This is based on an app shell exercies from Building Performant Progressive Web Apps from Scratch by Jad Joubran.

/*
Simple, no frills, debounce function.
*/
const debounce = (func, waitMs) => {
let timeout;
return () => {
if (timeout) {
clearTimeout(timeout);
}
@median-man
median-man / mongodb-mac-uninstall.md
Last active October 24, 2024 16:38
Uninstall MongoDB on Mac
@median-man
median-man / javascript.json
Last active November 8, 2019 14:45
VSCode User Snippets
{
"react component": {
"description": "A functional react component file template.",
"prefix": ["re", "rc", "react-comp", "comp"],
"body": [
"import React from \"react\"",
"",
"const ${1:ComponentName} = () => <div>${1:ComponentName} Component</div>",
"",
"export default ${1:ComponentName}",