Skip to content

Instantly share code, notes, and snippets.

View ChristopherA's full-sized avatar

Christopher Allen ChristopherA

View GitHub Profile
@ChristopherA
ChristopherA / macupdatecli.sh
Last active February 25, 2019 18:52
Update MacOS & Install Command Line Interface
# curl -L https://gist.githubusercontent.com/ChristopherA/a598762c3967a1f77e9ecb96b902b5db/raw/macupdatecli.sh | bash
sudo -v
sudo /usr/sbin/softwareupdate -l
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
sudo /usr/sbin/softwareupdate -ia
rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
git -C "$(brew --repo homebrew/core)" fetch --unshallow
@ChristopherA
ChristopherA / RevertRepo.md
Last active March 4, 2019 01:09
Revert git repository to remote master

Setting your branch to exactly match the remote branch can be done in two steps:

git fetch origin
git reset --hard origin/master

If you want to save your current branch's state before doing this (just in case), you can do:

@ChristopherA
ChristopherA / git_helpers.zsh
Created August 12, 2019 23:05 — forked from singajeet/git_helpers.zsh
Contains function to work with github repo and gists
#! env zsh
########################################
# git_helper.zsh
# Author: Ajeet Singh
# provides functions as commands for git
########################################
#variables
export GIST_UPLOAD_URL="https://api.github.com/gists"
export GIST_DOWNLOAD_URL="https://gist.github.com"
@ChristopherA
ChristopherA / heroku.md
Last active November 5, 2019 04:10
Heroku Notes
heroku login
heroku git:remote -a HEROKU-APP-NAME
git push heroku master
@ChristopherA
ChristopherA / revertgithub.md
Created November 6, 2019 05:02
How to Revert Github Repos #github #git #revert

To revert a GitHub repo to a previous commit

git revert HEAD

If your last commit was a merge, a little more love is needed:

git revert -m 1 HEAD
@ChristopherA
ChristopherA / FixDropboxPermissions.md
Created November 26, 2019 23:36
Fix Dropbox Permissions Resync Issue

Problem

Before a reboot, my Dropbox is fully synced.

After I reboot, I get a message saying that Dropbox needs to set permissions on my Dropbox folder, and then it does a full resync check of my very large Dropbox folder, which can take hours or overnight on a slow connection.

Solution

The problem may be symlinks set by older apps (Dropbox does not support symlinks INSIDE the dropbox folder as of 2019).

@ChristopherA
ChristopherA / ChristopherA-357405ED.asc
Last active November 27, 2019 09:01
GPG / Minisign Circle for @ChristopherA
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFUvF/kBEADBDybeTPzanyukrpU0RSmowvw5jVKNVQWaJ90ClL02d2CsUIWV
gyropXvO+QA78aa5GWKtHbUNIVQejP+BaRYk+LA91659RD4DB+YoqWO3pA3CzZVC
Q/4uLoVH/GTnt9LUOBl0Gacrt4t/ZYoCDyEysHxbb5bYeT43o+Hrpenb77v5aA+d
GPty6bimxGKHWUC6k6iogbdak+Jfu6B13P3D4tJDWUDqGmc3UhpjDR9rBCp2MrR8
vkdq/JWAnWZTv/HByBTHUVl4wvZ0CEffLSHgp0/3CCVfCwKr31xnJKVHOhaRL4XC
MwFY9aS04WKPSPHa2anyFC8jP/zMcuXySLtD/QVMnP+QK3lLBpQLOZ7BmgmlaNrG
WVoa0d6riynn1wHVIsIzjQMLWWslSs8s7CtB6O0rF9K/WAYDYDJsaahWqXRyuE80
vViRoGSM9HannBPEWSGhIegp8QX8rPEZKikXRaqV6czJeGsx+hW0P26wVRiK5DdN
@ChristopherA
ChristopherA / README.md
Last active November 30, 2019 01:45
example(): bash function to create a nicely formatted example of a shell command and its output #bash #tutorial #document

example(): bash function to create a nicely formatted example of a shell command and its output.

example() { echo "EXAMPLE:"; echo; echo " $@"; echo; echo "OUTPUT:"; echo ; eval "$@" | sed 's/^/ /'; }

Sample Output:

EXAMPLE:

 example ls -l
@ChristopherA
ChristopherA / mp4to3indir.sh
Created November 30, 2019 03:00
Convert all mp4 video in current directory to mp3 audio using ffmpeg #audio #video #convert #mp3 #mp4
#!/bin/sh
# Convert all mp4 video in current directory to mp3 audio using ffmpeg
for f in *.mp4; do ffmpeg -i "$f" -acodec libmp3lame -ab 192k "${f%.mp4}".mp3; done
@ChristopherA
ChristopherA / FFmpeg.sh
Created November 30, 2019 03:01 — forked from AffanIndo/FFmpeg.sh
FFmpeg Cheat Sheet
# batch convert
for i in *.mp4; do ffmpeg -i "$i" "${i%.mp4}.webm"; done
# convert from one format to another
ffmpeg -i input.mp3 output.wav
# convert from one video format to another ("-qscale" value are 0-10, 0 is the best)
ffmpeg -i input.mp4 -qscale 0 output.webm
# convert video to audio (sometimes this one is better than the custom one below)