Skip to content

Instantly share code, notes, and snippets.

View jmervine's full-sized avatar

Joshua Mervine jmervine

View GitHub Profile
@jmervine
jmervine / splunk.sh
Last active March 29, 2021 19:46
Simple script to start and seed a local splunk instances using Docker
#!/usr/bin/env bash
# Simple script to start and seed a local splunk instances using Docker
# Usage:
# $ bash splunk.sh [USERNAME] [HEC TOKEN]
PASSWORD="$1"
TOKEN="$2"
test -z "$PASSWORD" && PASSWORD=password
test -z "$TOKEN" && TOKEN=token
@jmervine
jmervine / general.md
Last active July 21, 2021 23:42
WoW Macros

General Macros and Commands

Commands

Change Cursor Size

Options:

  • -1 is auto
  • 0 is smallest
  • 2 is biggest
/console cursorsizepreferred 2
#############################################################
# Function -- Boot2Docker
#############################################################
if test "$(which boot2docker 2> /dev/null)"; then
function docker_shellinit {
local _shellinit="$(boot2docker shellinit)"
eval "$(echo ${_shellinit})"
echo "${_shellinit}" > ~/.boot2dockerrc
}
###
# Usage:
#
# Download this file and start by running 'make'. Then run
# each target listed, 'make lesson_one', 'make lesson_two',
# etc.
#
introduction:
# Introduction:
@jmervine
jmervine / 1results.md
Last active August 29, 2015 14:00
Pythagorean Triplet - run time of go vs. java vs. node vs. ruby vs. python vs. perl vs. php vs. c++

Pythagorean Triplet

Note: The method used below is very slow, with 1bb iterations when trying to find 1000. For a faster method see: https://gist.github.com/jmervine/b5d985398b3ca7ba16aa (~125k iterations)


A Pythagorean triplet is a set of three natural numbers, a b c, for which,

a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52.

/*
Author: Joshua P. Mervine <joshua@mervine.net> [github.com/jmervine]
See: http://jsfiddle.net/jmervine/dqA9r/5/
Use:
<script src="http://cdn.mervine.net/FormattedDate.js" />
<script src="http://cdn.mervine.net/FormattedDate.min.js" />
@jmervine
jmervine / goinst.sh
Last active July 31, 2016 02:36
Installing GoLang - Ubuntu 12.04.3 LTS \n \l
#!/usr/bin/env bash
#
# Example usage:
#
# $ VERSION=1.3 sudo ./goinst.sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@wookimiii
wookimiii / grco.bash
Last active September 15, 2021 22:06
Check out a branch using grep
#!/bin/bash
BRANCHES=$(git branch -ra | grep $1)
NUM=$(echo "$BRANCHES" | wc -l)
# check for empty
if [ "X$BRANCHES" = "X" ]
then
echo "No branch matches $1"
fi
@igrigorik
igrigorik / github.bash
Last active December 22, 2023 23:55
Open GitHub URL for current directory/repo...
alias gh="open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"