Skip to content

Instantly share code, notes, and snippets.

Jake Bathman jakebathman

Block or report user

Report or block jakebathman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jakebathman
jakebathman / provision_irc_server.sh
Last active Jun 29, 2018
IRC server setup on CentOS 7
View provision_irc_server.sh
#!/bin/bash
# This sets the variable $IPADDR to the IP address the new Linode receives.
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
sudo yum update -y
sudo yum install nginx wget git -y
cd ~
@jakebathman
jakebathman / scrape_ign_fortnite_map_tiles.php
Created May 10, 2018
Scrape the IGN Fortnite map tiles and re-construct a large map image
View scrape_ign_fortnite_map_tiles.php
<?php
/*****
If you have PHP installed, run this from the command line:
php scrape_ign_fortnite_map_tiles.php
**/
ini_set('memory_limit','2048M');
@jakebathman
jakebathman / random.sh
Created Apr 25, 2018
Random string generator
View random.sh
# Use these on the command line to generate random strings
# Tested in CentOS and macOS
# All printable characters
head /dev/urandom | LC_CTYPE=C tr -dc "[:print:]" | head -c 32
# Only A-Za-z0-9
head /dev/urandom | LC_CTYPE=C tr -dc "A-Za-z0-9" | head -c 32
# Alphanum with some special characters
@jakebathman
jakebathman / gfu.sh
Last active Apr 20, 2018
Update a repo fork with the original (upstream)
View gfu.sh
#!/bin/zsh
# sync a fork using the upstream branch
gfu(){
BRANCH="$1"
if [ -z "$1" ]; then
BRANCH="master"
fi
@jakebathman
jakebathman / remove_laravel_comments.php
Last active May 17, 2019
Remove comments from fresh Laravel files
View remove_laravel_comments.php
<?php
/*
|--------------------------------------------------------------------------
| Remove Laravel Comments
|--------------------------------------------------------------------------
|
| Just made a new Laravel project, but don't want all those big
| comment blocks? Put this in the root of your project and run
| "php remove_laravel_comments.php"
|
@jakebathman
jakebathman / is_backblaze_uploading.sh
Created Feb 15, 2018
Determine if Backblaze is currently backing up files on macOS
View is_backblaze_uploading.sh
#!/bin/sh
# This will look at the overviewstatus.xml file and
# determine if Backblaze is currently transmitting a file.
#
# Developed against:
# macOS 10.13.3
# Backblaze 5.2.0.172
BBSTATUS='/Library/Backblaze.bzpkg/bzdata/overviewstatus.xml'
@jakebathman
jakebathman / .tmux.conf
Last active Dec 14, 2017
Customizing tmux
View .tmux.conf
# Many of these customizations are from
# http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
@jakebathman
jakebathman / shell_commands.sh
Last active Jan 6, 2018
Various shell commands that I always have to look up
View shell_commands.sh
# Delete files based on a pattern
# The example below removes PDF files in nested directories, such as ./50/round_2/foo.pdf
# but would NOT remove the file ./50/packages/foo.pdf
find . -regextype posix-extended -regex ".*/round.*\.pdf" -exec rm {} +
# Delete a history item by its ID
history # get the ID (left-hand number) for the item you want to remove
history -d item_number
# Delete keys in redis matching some pattern, atomically
@jakebathman
jakebathman / readme.md
Last active Sep 6, 2017
A list of HH QRP agencies in exempted counties from Hurricane Harvey
View readme.md

Hurricane Harvey QRS Exemptions

The list below (in three different formats) are for Home Health Agencies whose ZIP code intersects with one of the exempted counties or parishes in Texas and Louisians, as determined by CMS.

Full information about the exemption is here: https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/Hospice-Quality-Reporting/Downloads/2017-121-IP-Quality-Program-Exemptions-for-FEMA-Texas-Louisiana-Provider.pdf

Additional updates on Hurricane-related exemptions is being posted by CMS here: https://www.cms.gov/About-CMS/Agency-Information/Emergency/Hurricanes.html

The agency data was pulled on September 6th, 2017 from the CMS website here: https://data.medicare.gov/Home-Health-Compare/Home-Health-Care-Agencies/6jpm-sxkc

@jakebathman
jakebathman / arrayToTable.php
Created Aug 14, 2017
Make a quick HTML table from a PHP array
View arrayToTable.php
function arrayToTable(array $values, array $headers = [])
{
$options = [
'tableStyle' => 'border: 1px solid black;border-collapse: collapse;',
'thStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;',
'tdStyle' => 'border: 1px solid black;padding: 5px 7px;text-align: center;',
];
$th = "<th style='" . $options['thStyle'] . "'>";
$td = "<td style='" . $options['tdStyle'] . "'>";
You can’t perform that action at this time.