Skip to content

Instantly share code, notes, and snippets.

View beporter's full-sized avatar

Brian Porter beporter

View GitHub Profile
@beporter
beporter / composer
Last active September 11, 2015 18:55
A wrapper script for composer that recognizes a COMPOSER_NODEV environment variable. See: https://github.com/composer/composer/issues/4408
#!/usr/bin/env bash
# beporter@users.sourceforge.net
#---------------------------------------------------------------------
usage ()
{
cat <<EOT
${0##*/}
Wrapper around composer to make it "aware" of a custom
@beporter
beporter / weekbyweek.php
Created September 2, 2015 23:10
A quick command line PHP script to scrape "week by week" pregnancy updates from thebump.com's API into local .html files.
<?php
/**
* A command line script to grab the "week-by-week" updates from
* TheBump.com's API and save them to local .html files.
*
* Tries to be respectful and cache all results to avoid unecessary HTTP
* calls. Uses the API key that thebump.com's own website uses. No malice
* is intended by this.
*
* Usage:
@beporter
beporter / sfcvs2git.sh
Last active August 29, 2015 14:27
A script to automate converting a SourceForge.net CVS repo into a git repo.
#!/usr/bin/env bash
#
#---------------------------------------------------------------------
usage ()
{
cat <<EOT
${0##*/}
Wraps up the commands required to dump a SourceForge CVS repo
@beporter
beporter / git-find-repos
Created August 10, 2015 22:04
Find all git repos (folders containing a `.git/` subdirectory) in the provided path (defaults to current directory.)
#!/usr/bin/env bash
#
# Find and list all git repos (folders containing .git/ directories)
# in the provided path (defaults to current dir.)
#
# Designed to run on a Mac, so make sure you have GNU `findutils`
# and the `terminal-notifier` gem installed.
#
# beporter@users.sourceforge.net
# v1.0 2015-08-10
@beporter
beporter / git-deploy
Last active June 9, 2016 18:02
A git add-on script that automates fast-forwarding branches to each other, pushing to the default remote (origin) and triggering pre/post scripts. Read `usage()` for details.
#!/usr/bin/env bash
#
# https://gist.github.com/beporter/8074237fa5a71f77dc5c
# beporter@users.sourceforge.net
# 2015-09-14
#---------------------------------------------------------------------
usage ()
{
@beporter
beporter / composer-create-project-test.sh
Last active January 9, 2020 20:28
Make the process of testing a `composer create-project` command easier by operating against your local working copy.
#!/usr/bin/env bash
# Allows you to test the create-project process using your local
# checked-out copy of the skeleton as the source. You MUST commit the
# changes you want to test to a git branch! You MUST name that branch
# as the first argument and the destination path to set up the fresh
# copy into as the second.
#
# Usage:
# - Place this script in your package's root directory and make it executable.
# - Set the PACKAGE_NAME variable below to match your composer.json's `name`.
@beporter
beporter / keybase.md
Created November 5, 2014 21:32
Proving GitHub identity for Keybase.

Keybase proof

I hereby claim:

  • I am beporter on github.
  • I am beporter (https://keybase.io/beporter) on keybase.
  • I have a public key whose fingerprint is A6BB 0797 14AB 98D6 302E 340F CFDE 3154 EF8B 48D3

To claim this, I am signing this object:

@beporter
beporter / nostalgia.c
Created October 29, 2014 13:35
Decided to see if I could still write C from memory.
// Compile: `gcc -Wall -o hello nostalgia.c`
// Run: `./hello`
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char** argv) {
printf("Hello world.\n");
return(0);
}
@beporter
beporter / monitor-500.sh
Last active August 29, 2015 14:08
Monitor a URL for HTTP 500 errors using a crude shell script.
#!/usr/bin/env bash
#
# Takes a URL as an argument. Will test that URL every X seconds for a
# 500 response code. If a 500 is returned, this script will ring the
# terminal's bell and print a message.
#
# Ref: http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/
#
# Usage: ./monitor-500.sh "http://yoursite.com/your/page.html"
#
@beporter
beporter / vmnetshop.sh
Last active March 31, 2020 04:46
Shut down VM network bridges on a Mac
#!/usr/bin/env bash
#
# If you're like me and have to switch between VMware Fusion and
# VirtualBox virtual machines on your Mac frequently, then you've
# probably run into one of the associated errors in this gist
# (https://gist.github.com/beporter/2841de37edbcc48a8755), particularly
# if you're using vagrant. This script shuts down or removes the bridge
# interfaces from BOTH providers so that they can start up cleanly again
# without conflicting with each other and without having to reboot your
# Mac.