Skip to content

Instantly share code, notes, and snippets.

View scottymeyers's full-sized avatar
🪐

Scott Meyers scottymeyers

🪐
View GitHub Profile
@scottymeyers
scottymeyers / image-data-resize.js
Created March 16, 2022 02:33 — forked from mauriciomassaia/image-data-resize.js
ImageData resize on Canvas
export async function resizeImageData (imageData, width, height) {
const resizeWidth = width >> 0
const resizeHeight = height >> 0
const ibm = await window.createImageBitmap(imageData, 0, 0, imageData.width, imageData.height, {
resizeWidth, resizeHeight
})
const canvas = document.createElement('canvas')
canvas.width = resizeWidth
canvas.height = resizeHeight
const ctx = canvas.getContext('2d')
@scottymeyers
scottymeyers / canvas-percent-coverage-visual.markdown
Created October 19, 2020 15:55
Canvas Percent Coverage Visual

Canvas Percent Coverage Visual

Divvy's up the HTML Canvas into equally sized squares and draws color onto a specified percentage of them.

A Pen by Scott Meyers on CodePen.

License.

// convert 4 spaces to 2
:%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// convert tab to 2 spaces
:%s/\t/ /g
// delete trailing whitespace
:%s/\s\+$//e
@scottymeyers
scottymeyers / gitflow-breakdown.md
Created January 15, 2018 15:21 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@scottymeyers
scottymeyers / gist:7261de0fb613b58b34c451a856b221a7
Created January 2, 2018 16:08
Setup Wordpress as GIT Submodule
git submodule add git://github.com/WordPress/WordPress.git wordpress
git commit -m 'Add WordPress submodule'
cd wordpress
git tag # list tags
git checkout 4.2.2 # checkout latest version
cd ..
git add wordpress # stage updates
git commit -m 'Checkout latest WordPress version'
@scottymeyers
scottymeyers / _flightplan_deployments.md
Last active January 15, 2018 16:41 — forked from wiledal/__flightplan_deployments.md
Set up your local machine and remote machine for quick deployments with Flightplan

Deploying

For easy deployments we're using flightplan, install with npm install -g flightplan.

Before deploying you need to make your computer a friend to the server.
You only need to do these steps once per machine.

We are going to be adding your public key to the remote server for passwordless SSH.
Then we are going to set up your SSH to allow for Agent Forwarding, so that your git commands are tunneled to the server.

When a step says Locally it means you should execute the command on your local machine.

@scottymeyers
scottymeyers / jekyll_create_post.rb
Last active November 28, 2016 17:15
Jekyll post creation script - provide a Title & directory of images.
#!/usr/bin/env ruby
require 'optparse'
# check for post title and image directory options
options = {}
OptionParser.new do |parser|
parser.banner = "Usage: jekyll_create_post.rb [options] [arguments...]"
parser.separator "This program creates a new Jekyll Post."