Skip to content

Instantly share code, notes, and snippets.

View heaversm's full-sized avatar

Mike Heavers heaversm

View GitHub Profile
@heaversm
heaversm / startup-marketing-checklist.md
Created December 28, 2022 17:08
Startup Marketing Checklist
View startup-marketing-checklist.md

Pre-Launch

Marketing starts long before you launch. Market research, planning, and preparation are critical parts of any marketing strategy.

Competitor Research

I have been up against tough competition all my life. I wouldn't know how to get along without it. - Walt Disney

@heaversm
heaversm / co2fromeventflights.js
Created October 25, 2022 02:50
all-company-trip co2 estimator
View co2fromeventflights.js
let totalPeopleInDirectory = 0;
let peopleWithUnknownLocation = 0;
let numLocations;
const locations = [];
const addPersonToTotal = function () {
totalPeopleInDirectory += 1;
};
const addToPeopleWithUnknownLocation = function () {
@heaversm
heaversm / docker-compose.yml
Created August 30, 2022 16:07
Docker Compose Running Cypress Tests
View docker-compose.yml
version: '3'
services:
# the client container, running webpack and the dev server
client:
image: path_to/image
networks:
- allhosts
volumes:
@heaversm
heaversm / regex-wrap-inside-tags.md
Last active August 9, 2022 16:30
regex: wrap all text inside matching tags
View regex-wrap-inside-tags.md
  • Find: <p class="italic text-center">(.+?)<\/p>
  • Replace: <p class="italic text-center"><time class="dt-published" datetime="$1">$1</time></p>
  • Example: <p class="italic text-center">03/01/2015</p>
  • Result: <p class="italic text-center"><time class="dt-published" datetime="03/01/2015">03/01/2015</time></p>
@heaversm
heaversm / react-express-heroku-quickstart.md
Last active July 6, 2023 00:37
Easy up and running Create React App with Express backend running on Heroku with auto-deploys
View react-express-heroku-quickstart.md
@heaversm
heaversm / useful-sass.scss
Last active September 16, 2020 17:21
Useful sass mixins
View useful-sass.scss
#fluid type between a small and large screen size / small & large font size
@mixin fluid-type($min-vw, $max-vw, $min-font-size, $max-font-size) {
$u1: unit($min-vw);
$u2: unit($max-vw);
$u3: unit($min-font-size);
$u4: unit($max-font-size);
@if $u1 == $u2 and $u1 == $u3 and $u1 == $u4 {
& {
@heaversm
heaversm / useful-github-commands.sh
Last active September 25, 2020 17:39
Github Commands
View useful-github-commands.sh
#Clone and checkout a single github branch
git clone --single-branch --branch <branchname> <remote-repo>
#delete all local branches matching pattern
git branch | grep "mh/#*" | xargs git branch -D
#set up git post-receive hooks for autodeployment
#source: https://www.digitalocean.com/community/tutorials/how-to-set-up-automatic-deployment-with-git-with-a-vps
#on VPS:
@heaversm
heaversm / js-library-glitch-fixes.js
Created April 5, 2020 16:30
Fixes for some weird but crucial bugs in JS
View js-library-glitch-fixes.js
//Polyfill for aframe/threejs raycasting
//navigator.xr.requestDevice is not a function
//see https://github.com/aframevr/aframe/issues/4354#issuecomment-567052948
navigator.xr.requestDevice = navigator.xr.requestDevice || function () {
return new Promise((resolve, reject) => {
resolve({
supportsSession: new Promise((resolve, reject) => {
resolve({
immersive: true,
View Useful-css.css
.next-image-button:focus { /* disable focus ring */
outline: none;
}
.next-image-button:focus-visible { /* enable focus ring for assistive devices */
outline: 3px solid blanchedalmond;
}
/* avoid layout flash on images by setting default aspect ratio equal to initial width and height of html element */
@heaversm
heaversm / vscode-tips.md
Last active February 2, 2020 15:36
VSCode Shortcuts
View vscode-tips.md

VSCode Shortcuts

MOUSE AND KEYBOARD

  • option + dbl_click to multiselect entire words.
  • opt + cmd + ↓ selects multiple lines
  • Pasting multi-line content into multi-line cursors distributes them, for example, among list items
  • cmd + d selects additional instances of the highlighted code
  • shift + cmd + l selects all instances of the highlighted code
  • shift + → expands selection one space