Skip to content

Instantly share code, notes, and snippets.

K Adam White kadamwhite

Block or report user

Report or block kadamwhite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kadamwhite
kadamwhite / access-vscode-extension-list.md
Last active May 8, 2019
Visual Studio Code Preferences
View access-vscode-extension-list.md

From Joe M, "you can get your current extensions list by typing code --list-extensions in CLI" His list:

alefragnani.Bookmarks
annsk.alignment
dbaeumer.vscode-eslint
donjayamanne.githistory
eamodio.gitlens
EditorConfig.EditorConfig
eg2.vscode-npm-script
@kadamwhite
kadamwhite / dashed_rectangle.pde
Last active Apr 24, 2019
Dashed Rectangle (Processing)
View dashed_rectangle.pde
import processing.pdf.*;
//boolean saveOneFrame = false;
int randomInt( int min, int max ) {
return floor( random( min, max ) );
}
void dashedHorizontalLine( int x1, int y1, int x2, int y2 ) {
if ( y1 != y2 ) {
@kadamwhite
kadamwhite / invader.css
Created Sep 5, 2012
Pure-CSS Space Invader
View invader.css
/**
* Pure-CSS Space Invader, adapted to a 2px pixel size from
* the original example at CSS-Tricks "The Shapes of CSS"
*
* @link: http://css-tricks.com/examples/ShapesOfCSS/
*/
.invader {
box-shadow:
-4px -2px white, 4px -2px white,
@kadamwhite
kadamwhite / api-testbed.js
Last active Mar 18, 2019
wpapi lightweight testbed
View api-testbed.js
/* eslint-disable no-console */
/**
* A little module that adds a wpapi() method to the window object.
*
* wpapi() takes an API path (e.g. /wp/v2/posts), optionally containing string query parameters,
* or a query-less API path and a hash object of query param objects.
*/
( context => {
const { root, nonce } = context.WP_API_Settings;
View Thing.js
var { convert, svgify } = (() => {
function sum( collection, prop ) {
return collection.reduce( ( sum, item ) => sum + item[prop], 0 );
}
function testEq( a, b ) {
if ( a !== b ) {
throw new Error( `Expected ${ a } to equal ${ b }` );
}
}
@kadamwhite
kadamwhite / convert-to-gif
Last active Jan 9, 2019
Spider a directory and make a short gif from each one. Ensure convert-to-gif is in your path before running `node make-gifs.js`
View convert-to-gif
#!/usr/bin/env node
/*
This script will clip a segment of a video file into a gif, using techniques
described in these resources:
https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
https://video.stackexchange.com/questions/4563/how-can-i-crop-a-video-with-ffmpeg
https://askubuntu.com/questions/648603/how-to-create-an-animated-gif-from-mp4-video-via-command-line
https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
@kadamwhite
kadamwhite / hmr-helpers.js
Created Oct 31, 2018
Gist of how I auto-load plugin and block code within a Gutenberg project.
View hmr-helpers.js
const { blocks, plugins } = wp;
const { dispatch, select } = wp.data;
/**
* When a selected block is being disposed during a hot module reload, persist
* its clientId so it may be reselected after the new module version loads.
*
* If the block being unloaded is currently selected, clear that selection to
* avoid a Gutenberg error that occurs when unregistering a selected block.
*
@kadamwhite
kadamwhite / File Structure.md
Last active Oct 17, 2018
Helpers I use for local WordPress development.
View File Structure.md

Local WordPress Core Development Helpers

This is a collection of scripts, bash functions, and config files that help me do WordPress core development.

Folder Structure

  • /wp: parent folder
  • /wp/svn: SVN checkout
  • /wp/git: Git checkout
  • /wp/{ git | svn }/wp-test-config.php: see attached file
View .bach_profile
Johann Sebastian Bach (31 March [O.S. 21 March] 1685 – 28 July 1750) was
a German composer and musician of the Baroque period. He enriched established
German styles through his skill in counterpoint, harmonic and motivic
organisation, and the adaptation of rhythms, forms, and textures from abroad,
particularly from Italy and France. Bach's compositions include the Brandenburg
Concertos, the Goldberg Variations, the Mass in B minor, two Passions, and over
three hundred sacred cantatas of which nearly two hundred survive. His music
is revered for its technical command, artistic beauty, and intellectual depth.
http://en.wikipedia.org/wiki/Johann_Sebastian_Bach
@kadamwhite
kadamwhite / chassis-openssl-readme.md
Created Jul 3, 2018
Proposed roborourke/chassis-openssl README change (WIP0)
View chassis-openssl-readme.md

Adding the certificate to your keychain

To avoid the red "your connection is not encrypted" message, you'll have to add the generated .cert to your keychain.

macOS

sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain yourlocaldomain.cert
You can’t perform that action at this time.