Skip to content

Instantly share code, notes, and snippets.

View josephspurrier's full-sized avatar

Joseph Spurrier josephspurrier

View GitHub Profile
@josephspurrier
josephspurrier / linux.sh
Last active November 4, 2019 17:10
Install Go
# Download Go (use any of the latest versions)
curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
# Extract Go
tar -xvf go*.tar.gz
# Install Go
sudo mv go /usr/local
# Create a workspace folder
@josephspurrier
josephspurrier / etc-init.d-hello-world
Last active May 15, 2021 17:14
/etc/init.d Script for Go Application
#!/bin/bash
#
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions
<form>
<div style="width: 400px; margin: 0 auto; text-align: center; padding-top: 100px;">
<h1>
<span style="color: blue;">G</span>
<span style="color: red;">o</span>
<span style="color: yellow;">o</span>
<span style="color: blue;">g</span>
<span style="color: green;">l</span>
<span style="color: red;">e</span>
</h1>
@josephspurrier
josephspurrier / .bash_profile
Last active September 13, 2022 21:25
macOS Bash Profile
#################################################################################
#
# Bash Configurations and Aliases for OS X
#
# Latest: https://gist.github.com/josephspurrier/acf7327726df6587a56ff2c2062314fa
# This was modified so it can be included in your ~/.zshrc file with the command:
# source ~/.bash_profile
#
# It's recommended to use oh-my-zsh:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Keybase proof

I hereby claim:

  • I am josephspurrier on github.
  • I am josephspurrier (https://keybase.io/josephspurrier) on keybase.
  • I have a public key whose fingerprint is 3FC8 C7DA FEAD 9308 EC4D 1129 313E F9D9 CED7 C310

To claim this, I am signing this object:

@josephspurrier
josephspurrier / http_test.go
Created July 6, 2016 05:53
Test POST Request in Go
package main
import (
"log"
"net/http"
"net/http/httptest"
"net/url"
"strings"
)
@josephspurrier
josephspurrier / gen.go
Last active June 3, 2016 01:02
Fill a template with variables in Go
package main
import (
"encoding/json"
"io/ioutil"
"log"
"os"
"path/filepath"
"text/template"
)
@josephspurrier
josephspurrier / AwsController.php
Last active February 24, 2019 15:08
Laravel 5.2 Workflow with Service Providers
<?php
// File Location: projectroot/app/Http/Controllers/AwsController.php
namespace App\Http\Controllers;
use \App;
use \AwsS3;
class AwsController extends Controller
@josephspurrier
josephspurrier / php-aws-composer
Last active May 18, 2016 18:07
Set up AWS PHP Project on OS X with Composer
################################################################################
# Set up PHP Project on OS X with Composer
################################################################################
# Download Composer
curl -sS https://getcomposer.org/installer | php
# Move to a global location
mv composer.phar /usr/local/bin/composer
@josephspurrier
josephspurrier / database.go
Last active May 30, 2017 02:10
User Model in Bolt
package database
import (
"log"
"github.com/boltdb/bolt"
)
var (
BoltDB *bolt.DB // Bolt wrapper