Skip to content

Instantly share code, notes, and snippets.

View bradparks's full-sized avatar

Brad Parks bradparks

  • Fredericton, New Brunswick, Canada
View GitHub Profile
@bradparks
bradparks / make_portable.sh
Created May 20, 2021 00:53 — forked from Birch-san/make_portable.sh
Make a macOS executable binary or .dylib portable
#!/usr/bin/env bash
# Licensed by author Alex Birch under CC BY-SA 4.0
# https://creativecommons.org/licenses/by-sa/4.0/
# Example input:
# ./make_portable.sh mycoolbinary
# where mycoolbinary is a mach-o object file
# (for example an executable binary or a .dylib)
#
@bradparks
bradparks / Dockerfile
Created April 9, 2021 00:11 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@bradparks
bradparks / AddCustomEditorMenuItem.cs
Created February 26, 2021 01:29 — forked from Domiii/AddCustomEditorMenuItem.cs
Adds a new "Add custom Editor" MenuItem to Script files in the Unity Project view (download *.unitypackage file here: https://files.fm/u/j4r8cve5 )
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text.RegularExpressions;
@bradparks
bradparks / aws.md
Created January 15, 2021 18:18 — forked from colinvh/aws.md
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@bradparks
bradparks / tmux_local_install.sh
Created June 14, 2020 00:58 — forked from rothgar/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
TMUX_VERSION="2.1"
LIBEVENT_VERSION="2.0.20"
NCURSES_VERSION="6.0"
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
@bradparks
bradparks / example.md
Created May 19, 2020 11:55 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@bradparks
bradparks / nexus_watch.sh
Created April 18, 2020 00:28 — forked from cpu/nexus_watch.sh
Watch a URL for a specific phrase, use Pushover to alert with back-off.
#!/bin/bash
# Pushover API key
TOKEN="PUSHOVER_API_KEY_HERE"
# List of device keys to push to
KEYS=( KEY_ONE KEY_TWO )
# Url to monitor
URL=https://play.google.com/store/devices/details?id=nexus_4_16gb
@bradparks
bradparks / web-servers-one-liner-static-server.md
Last active January 20, 2020 21:46 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bradparks
bradparks / gist:2a27864347f98cdd4fb7a28caf19269d
Created November 18, 2019 14:27 — forked from jdoconnor/gist:6876052
loop through tmux windows, control c and exit
tmux list-window | awk -F":" '{system("tmux select-window -t "$1"; tmux send-keys C-c; tmux send-keys \"exit\"; tmux send-keys Enter")}'; tmux attach
@bradparks
bradparks / build-tmux.sh
Created October 29, 2019 10:28 — forked from mbreese/build-tmux.sh
HOWTO build a statically linked tmux in one script (downloads and builds dependencies from source)
#!/bin/bash
TARGETDIR=$1
if [ "$TARGETDIR" = "" ]; then
TARGETDIR=$(python -c 'import os; print os.path.realpath("local")')
fi
mkdir -p $TARGETDIR
libevent() {
curl -LO https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -zxvf libevent-2.0.22-stable.tar.gz