Skip to content

Instantly share code, notes, and snippets.

View brandonb927's full-sized avatar

Brandon Brown brandonb927

View GitHub Profile
{
"meta": {
"theme": "classy"
},
"basics": {
"firstName": "Brandon",
"lastName": "Brown",
"name": "Brandon Brown",
"email": "resume@brandonb.ca",
"phone": "",
@brandonb927
brandonb927 / template.pkr.hcl
Created March 23, 2021 16:36
A "truly noninteractive" Ubuntu-based Packer HCL template for dist-upgrade
build {
# ...
provisioner "shell" {
inline = [
"echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections",
"sudo apt-get update",
"sudo apt-get dist-upgrade -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef -y --allow-downgrades --allow-remove-essential --allow-change-held-packages",
"sudo apt-get autoremove -y",
"sudo apt-get clean",
@brandonb927
brandonb927 / meta-tags.md
Last active February 21, 2024 11:41 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags
@brandonb927
brandonb927 / index.js
Last active June 28, 2022 18:05
Cypress + Typescript ts-loader option `transpileOnly` config helps with memory-contrained machines if you're not running in the Cypress Dashboard but rather using custom Jenkins CI, etc.
module.exports = (on, config) => {
// ...
const wpOptions = webpack.defaultOptions
wpOptions.webpackOptions.resolve = {
extensions: ['.ts', '.js'],
}
wpOptions.webpackOptions.module.rules.push({
test: /\.ts$/,
exclude: [/node_modules/],
@brandonb927
brandonb927 / user-config.json
Created June 22, 2018 15:32
A clean UI for VS Code, user configuration
{
"editor.fontLigatures": true,
"editor.glyphMargin": false,
"editor.lineNumbers": "off",
"editor.snippetSuggestions": "top",
"editor.tabCompletion": true,
"editor.minimap.enabled": false,
"explorer.confirmDelete": false,
"explorer.openEditors.visible": 0,
"window.title": "${rootName}${separator}${activeEditorMedium}",
@brandonb927
brandonb927 / puppeteer-vscode-scraper.js
Last active February 22, 2022 00:51
A tiny self-contained node script to scrape the VS Code Marketplace website to get all the information about the packages you have installed in VS Code.
#!/usr/bin/env node
// $ npm install -d fs-extra ora open puppeteer
const { spawn } = require('child_process')
const readline = require('readline')
const path = require('path')
const fse = require('fs-extra')
const open = require('open')
@brandonb927
brandonb927 / convert-videos-for-web.sh
Created November 30, 2016 00:51 — forked from ob7/convert-videos-for-web.sh
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
#!/bin/bash
#Scaling
#- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
#- Other options include setting both with & height
#- Watch out for sizing errors when not divisible by 2
if [[ ! "$1" || ! "$2" || ! "$3" ]] || [[ "$1" = '--help' ]]; then
if [[ "$1" = '--help' ]]; then
echo " "
@brandonb927
brandonb927 / hull-height-square.css
Created August 29, 2016 17:52
Makes a square as large as possible in the viewport without overflowing and centres it vertically and horizontally - https://twitter.com/mikeriethmuller/status/769922629260181504
.elem {
width: 100vmin;
height: 100vmin;
margin-top: calc((100vh - 100vmin)/2);
margin-left: calc((100vw - 100vmin)/2);
}
@brandonb927
brandonb927 / check.sh
Last active February 22, 2022 00:52 — forked from remy/check.sh
Check original domain registration date of a domain
DOMAIN='brandonb.ca'; curl http://web.archive.org/cdx/search/cdx\?limit\=1\&url\=$DOMAIN | awk '{ print $2 }' | xargs date -j -f "%Y%m%d%H%M%S"
@brandonb927
brandonb927 / post-merge
Created June 28, 2016 03:20 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"