A semi-generic set of rc files I use for installing a new machine
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
#!/bin/sh | |
# Make or touch three files: formulas, casks, and fonts. | |
# In them, list their respective names of what you want installed. | |
echo "\033[1;37;45m \033[m" | |
echo "\033[1;37;45m installing formulas \033[m" | |
echo "\033[1;37;45m \033[m" | |
FORMULAS=`cat ./formulas` |
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
#!/bin/bash | |
THISDIR="dirname ${BASH_SOURCE}" | |
echo "Updating your repo." | |
echo "☕️ Take a break - this might take a few minutes." | |
git co development -q | |
git pull origin development --ff-only -q | |
git fetch --prune -q | |
bundle install --quiet | |
yarn install -s |
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
#!/bin/bash | |
# This is specifically for the go-filecoin repo but a subset of this can apply to any go project with git | |
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | |
set -Euo pipefail | |
echo "Updating your repo." | |
echo "☕️ Take a break - this might take a few minutes." | |
git stash | |
git co master -q |
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
#!/bin/sh | |
RUBOCOP_NAMES='\.(rb|rake)$' | |
ESLINT_NAMES='\.(es6|jsx|js)$' | |
PRETTIER_NAMES='\.(es6|jsx|js|scss|json)$' | |
RUBOCOP_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E $RUBOCOP_NAMES) | |
ESLINT_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E $ESLINT_NAMES) | |
PRETTIER_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E $PRETTIER_NAMES) |
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
package reflect_cats_test | |
import ( | |
"encoding/json" | |
"net/url" | |
"reflect" | |
"testing" | |
"github.com/stretchr/testify/assert" | |
"github.com/stretchr/testify/require" |
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
#!/bin/bash | |
export JSNAMES='\.(js|ts)$' | |
export JSNAMES=$(git diff --cached --name-only --diff-filter=ACM | grep -E $JSNAMES) | |
function exit_err() { echo "❌ 💔" ; exit 1; } | |
if [[ ! -z $JSNAMES ]] | |
then | |
echo "Examining $JSNAMES" | |
echo $JSNAMES | xargs npm run format || exit_err |
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
#!/bin/bash | |
export GO_NAMES='\.(go)$' | |
export GO_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E $GO_NAMES) | |
function exit_err() { echo "❌ 💔" ; exit 1; } | |
if [[ ! -z $GO_FILES ]] | |
then | |
echo "Examining $GO_FILES" | |
echo $GO_FILES | xargs gofmt -s -w || exit_err |
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
#!/bin/bash | |
# emojis help instantly recognize something went wrong and where | |
function exit_err() { echo "❌ 💔" ; exit 1; } | |
set -Euo pipefail | |
echo "Updating your repo." | |
echo "☕️ Take a break - this might take a few minutes." | |
git stash | |
git co master -q | |
git pull origin master --ff-only -q |
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 express = require('express'); | |
const app = express(); | |
const WebSocket = require("ws"); | |
app.get('/', function (req, res) { | |
res.send('This is not really a web page.'); | |
}); | |
const port = 3997 |