Skip to content

Instantly share code, notes, and snippets.

View jarrettbarnett's full-sized avatar

Jarrett Barnett jarrettbarnett

View GitHub Profile
@jarrettbarnett
jarrettbarnett / save_disney_photos
Last active May 26, 2016 14:26 — forked from focustrate/save_disney_photos
For exporting photos from Disney Photo Pass website
#!/bin/bash
#
# takes a url like this:
# http://www.disneyphotopass.com/api/photostore/getSharedImageList.ashx?ShareToken=[[token]]
# and saves all the pictures to ./disneypics
#
# url can be found by going to http://www.disneyphotopass.com/photoshare.aspx and sharing photos by email.
# the link will be in the email
[[ -n "$1" ]] || { echo "Please add the share url as a parameter"; exit 0; }
@jarrettbarnett
jarrettbarnett / .bash_profile
Last active May 26, 2016 14:25 — forked from RavenHursT/.bash_profile
Handy BASH aliases
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
<?php namespace JB;
/**
* Class NumberHelper Test
* @package JB
* @author Jarrett Barnett <hello@jarrettbarnett.com>
*/
class NumberHelper
{
/**
* Get Sum of Values Squared By Array Key
<?php
/**
* Test to see if a given string contains HTML tags
*/
function testIfContainsTag($input)
{
if (strpos($input, '<') > -1) {
return true;
} else {
return false;
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Report Builder</title>
</head>
<body>
<section class="report-section">
<div class="text-block">
<h1>Report Builder</h1>
@jarrettbarnett
jarrettbarnett / Vagrant Ethernet Issue.md
Last active March 20, 2017 17:25
Resolves the following error: Bringing up interface eth2: Device eth2 does not seem to be present, delaying initialization. [FAILED]

Option 1

1. Update .Vagrantfile

You can edit Vagrantfile file in any standard text editor or via VIM:

$ cd /Web
$ vim Vagrantfile

Locate a line that starts with:

@jarrettbarnett
jarrettbarnett / vcl-regex-cheat-sheet
Created March 21, 2017 18:44 — forked from dimsemenov/vcl-regex-cheat-sheet
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
req.url ~ "searchterm"
True if req.url contains "searchterm" anywhere.
req.url == "searchterm"
@jarrettbarnett
jarrettbarnett / crashplanFixup.sh
Created May 19, 2017 15:37 — forked from thewellington/crashplanFixup.sh
Prevent CrashPlan from de-duplicating data on a Mac. Improves transfer speed! #mac #blog #crashplan
#!/bin/bash
#
# crashplanFixup.sh for Macintosh OS X 10.9 (and probably earlier versions)
#
# This script will prevent CrashPlan from de-duplicating data on files greater than 1k.
# Based on information from http://networkrockstar.ca/2013/09/speeding-up-crashplan-backups/
#
# NOTE: Must be run with sudo! IE: $ sudo sh ./crashplanFixup
#
# v1.1 2014-03-13 by bill@wellingtonnet.net
@jarrettbarnett
jarrettbarnett / sphp.sh
Created July 17, 2017 23:48 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@jarrettbarnett
jarrettbarnett / warmly.sh
Created July 26, 2017 19:45 — forked from thomasfr/warmly.sh
A wget based easy poor man`s cache warmer script
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#