Skip to content

Instantly share code, notes, and snippets.

jaredhowland /
Created February 6, 2020 19:06 — forked from olets/
Make all MAMP PHPs available on command line, and default to the latest
# Henry Bley-Vroman, 2019
# Usage
# Paste or source this into your shell profile.
# Requires macOS and that your shell supports [[ ]] and '<string> == <starting substring>*'
# (Bash, Zsh, Ksh etc)
# alias php to the latest PHP installed with MAMP
MAMP_PHP__LATEST=$(ls /Applications/MAMP/bin/php/ | sort -V | tail -1)
alias php="/Applications/MAMP/bin/php/${MAMP_PHP__LATEST}/bin/php -c \"/Library/Application Support/appsolute/MAMP PRO/conf/${MAMP_PHP__LATEST}.ini\""
jaredhowland /
Created December 12, 2019 06:43 — forked from bsodmike/
HOWTO Ubiquity EdgeMAX Ad Blocking Content Filtering using EdgeRouter

Ubiquity EdgeMAX Ad Blocking Content Filtering using EdgeRouter

This is based on a guide on the Ubnt forums.

Log into your Edgerouter and run the following - sudo -i && vi /config/user-data/ This will switch you to the root user and open up vi.

jaredhowland /
Created March 3, 2017 15:15 — forked from seanbuscay/
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" >
git add
git commit -a -m "Initial Commit"
git push origin orphan_name
jaredhowland /
Created November 24, 2016 04:55 — forked from bmcbride/
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
jaredhowland / _decimal.scss
Created April 27, 2016 05:17 — forked from terkel/_decimal.scss
Rounding decimals in Sass
View _decimal.scss
// _decimal.scss | MIT License |
// Round a number to specified digits.
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
jaredhowland / Install Composer to use MAMP's
Created March 18, 2016 00:34 — forked from kkirsche/Install Composer to use MAMP's
How to install Composer globally using MAMP's PHP
View Install Composer to use MAMP's

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

jaredhowland / uniqueperms.m
Created March 14, 2016 19:24 — forked from tobin/uniqueperms.m
Generate unique permutations (Matlab)
View uniqueperms.m
function P = uniqueperms(varargin)
% This function allows two possible calling formats:
% perms_nodupes(syms)
% perms_nodupes(syms,counts)
% Here perms_nodupes returns all permutations of the vector SYMS.
% COUNTS is an optional vector indicating how many times each symbol should
% be included. The following are equivalent:
jaredhowland / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active September 27, 2021 12:12 — forked from ccstone/BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
BBEdit-TextWrangler Regular Expression Cheat-Sheet
View BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
jaredhowland / flavor.rb
Created May 13, 2014 19:07 — forked from ttscoff/flavor.rb
fix encoding problem with Ruby 2.0
View flavor.rb
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
# Requirements: json gem (`gem install json`)
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
# cat | flavor > README.html