Skip to content

Instantly share code, notes, and snippets.

View skwid138's full-sized avatar
🐅
Tiger Style

Hunter Rancourt skwid138

🐅
Tiger Style
View GitHub Profile
@skwid138
skwid138 / github-add-team-to-repos.js
Last active September 12, 2022 16:42 — forked from davidrleonard/add-team-to-repos.js
Add a new team to all Github repos in an organization
/*
* Adds the specificed team to all the repos in a Github organization.
* This is a tedious process in the UI.
* You'll need a version of node greater than 9 to run this
*
* https://docs.github.com/en/rest/teams/teams#add-or-update-team-repository-permissions
*
* Instructions:
* 1. Copy this file somewhere locally on your computer, e.g. ~/addteamrepos.js
* 2. Fill in the uppercase variables below with the right values

Helpful Commands

List containers

(The below are using the recomended commands although docker ps <options> would be identicle for now)

  • All containers: docker container ls -a
  • Running containers: docker container ls (docker ps is the exact same, but is no longer the recomended command)
  • All stopped containers: docker container ls -f "status=exited"
  • IDs of running containers: docker container ls -q
  • IDs of all containers: docker container ls -aq
  • Recently created containers: docker container ls -l
<?php
/**
* The table Printer class has no dependencies and generates an array of strings
* out of an array of objects or arrays and the child properties that should be printed given by an array of strings
*
* Should result in something like the following:
* +------+---------------+----------------+---------------+
* | id | name | col_name_three | col_name_four |
* +------+---------------+----------------+---------------+

Debug with the CLI

fwrite(STDERR, print_r($thing_to_debug, true));

Update and/or Upgrade fail with various git errors

Running brew upgrade or brew update results in some sort of git error

  • Merge conflict
  • Unfinished rebase

Use brew update-reset instead which I beleive downloads all the updates/upgrades fresh

Use brew doctor to get tips on what can be done to improve your local brew setup

#!/bin/bash
# Open Apps used when doing development
# Could also include "iTerm" if the script is set to run automatically
# As it is now it would likely be run from iTerm
declare -a apps=("JetBrains Toolbox"
"Viscosity"
"MySQLWorkbench"
"ClickUp"

Big Sur Indexing

After updating to Big Sur the spotlight search no longer finds apps

Temporary Fix (reboot will require doing this again)

Run sudo mdutil -E / Open Activity Monitor and force quit the SystemUIServer process

Credit: https://developer.apple.com/forums/thread/667316

/* h Styles */
h1, h2, h3, h4, h5, h6 {
font-family: futura-pt-bold, sans-serif, Helvetica Neue, Helvetica, Arial !important;
font-weight: 700;
margin: 0;
color: #fff; /* Hunter Added this because it seemed like the right thing to do at the time */
}
/****************
***** FONT ******
<?php
/**
* Template Name: Fullpage Slider
* @author: VLThemes
* @version: 1.0.2
*/
get_header();

Git Tips

Moved files or directories and git thinks they're deleted and new vs renamed.
The following will resolve most of this assuming the file contents themselves have not changed too much.
git add . -A

Add only previsouly staged or deleted files andd exclude unstaged (new) files
git add -u

Add only a portion of the changes in a file