A Pen by Scott Meyers on CodePen.
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') |
A Pen by Scott Meyers on CodePen.
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.
Take a few different approaches to filling up a grid's cells.
A Pen by Scott Meyers on CodePen.
// 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 |
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' |
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.
#!/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." |