Skip to content

Instantly share code, notes, and snippets.

💭
Battlesnake! https://play.battlesnake.io

Brandon Brown brandonb927

View GitHub Profile
View Play Battlesnake for Free!
__
_______ /*_>-<
___/ _____ \__/ /
<____/ \____/
https://play.battlesnake.io
@brandonb927
brandonb927 / index.js
Last active Jan 22, 2019
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.
View index.js
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 Jun 22, 2018
A clean UI for VS Code, user configuration
View user-config.json
{
"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 Feb 22, 2019
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.
View puppeteer-vscode-scraper.js
#!/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 Nov 30, 2016 — forked from ob7/convert-videos-for-web.sh
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
View convert-videos-for-web.sh
#!/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 Aug 29, 2016
Makes a square as large as possible in the viewport without overflowing and centres it vertically and horizontally - https://twitter.com/mikeriethmuller/status/769922629260181504
View hull-height-square.css
.elem {
width: 100vmin;
height: 100vmin;
margin-top: calc((100vh - 100vmin)/2);
margin-left: calc((100vw - 100vmin)/2);
}
@brandonb927
brandonb927 / check.sh
Last active Jun 26, 2018 — forked from remy/check.sh
Check original domain registration date of a domain
View check.sh
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 Jun 28, 2016 — 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/`.
View post-merge
#/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"
@brandonb927
brandonb927 / npm-ES2015-babel-react-build.json
Created Dec 17, 2015
npm scripts ES2015 + babel + react self-contained build
View npm-ES2015-babel-react-build.json
{
...
"devDependencies": {
"autoprefixer": "^6.1.2",
"babel-cli": "^6.3.17",
"babel-plugin-react-transform": "^2.0.0-beta1",
"babel-preset-es2015": "^6.3.13",
"babelify": "^7.2.0",
"bootstrap": "^3.3.6",
"browserify": "^12.0.1",
@brandonb927
brandonb927 / installed.md
Last active May 7, 2017
Installed Atom Packages
View installed.md

Sublime-Style-Column-Selection
Enable Sublime style 'Column Selection'. Just hold 'alt' while you select, or select using your middle mouse button. Also similar to Texmate's 'Multiple Carets', or BBEdit's 'Block Select'

activate-power-mode
Activate POWER MODE to write your code in style.

atom-alignment
A simple key-binding for aligning multi-line and multiple selections in Atom (Based on the sublime text plugin)

atom-beautify

You can’t perform that action at this time.