This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This file defines the project-level Webpack production configuration. It | |
* combines configs from all relevant plugins and themes into one single | |
* array (a "multi-configuration" Webpack setup) and runs those builds in | |
* a single pass. | |
*/ | |
const { basename, extname } = require( 'path' ); | |
const postcss = require( 'postcss' ); | |
const filtermq = require( 'postcss-filter-mq' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# Usage: | |
# | |
# Run this script (via an npm run alias) with no arguments to compute the | |
# issues in files changed since you branched from "development." | |
# | |
# npm run lint:php:changed | |
# | |
# Pass a specific branch name as the first argument to determine which files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const equalPoint = ( x1, y1, x2, y2 ) => ( x1 === x2 && y1 === y2 ); | |
const sum = nums => nums.reduce( ( sum, num ) => sum + num, 0 ); | |
// See https://stackoverflow.com/questions/9043805/test-if-two-lines-intersect-javascript-function | |
const linesIntersect = ( x1, y1, x2, y2, x3, y3, x4, y4 ) => { | |
if ( | |
equalPoint( x1, y1, x3, y3 ) || | |
equalPoint( x1, y1, x4, y4 ) || | |
equalPoint( x2, y2, x3, y3 ) || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { match } = require('assert'); | |
const { parse } = require('path'); | |
const readline = require('readline'); | |
const { getContainers, matchContainerByURL } = require( '/home/kadam/bin/get-docker-ips' ); | |
// Figure out if we asked for a certain number of events, or else show the 20 most recent. | |
const [ , , flag, val ] = process.argv; | |
let eventCount = 20; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const child_process = require( 'child_process' ); | |
/** | |
* Execute a command as a spawned process. | |
* | |
* @param {String} command A bash command string, excluding arguments. | |
* @param {String[]} args An array of argument strings for the provided command. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PREREQUISITES! | |
// | |
// 1. Plug in the controller before running sketch | |
// 2. Follow the steps below once to download the Game Control Plus library | |
// | |
// In the "Sketch" menu in Processing's menubar, go to | |
// Sketch > Import Library > Add Library | |
// Then search for "Game Control". You should find a library called "Game Control Plus"; | |
// install it and let Processing download all the files. | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
MODE="$1" | |
if [ $MODE = "on" ]; then | |
v4l2-ctl -d /dev/video0 --set-ctrl=saturation=0,contrast=190,brightness=105 | |
elif [ $MODE = "off" ]; then | |
v4l2-ctl -d /dev/video0 --set-ctrl=saturation=128,contrast=128,brightness=120 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float fillColor; | |
void setup() { | |
size(300, 200); | |
background(255, 255, 255); | |
fill(0, 0, 0); | |
// Draw one bar graph on the left, starting from the bottom and working clockwise | |
//=============================================================================== | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render, cleanup, fireEvent } from '@testing-library/react'; | |
import { useSelect, useDispatch } from '@wordpress/data'; | |
import '@testing-library/jest-dom/extend-expect'; | |
import { storeProvider } from '../store-provider'; | |
describe('storeProvider', () => { | |
afterEach(cleanup); |