Skip to content

Instantly share code, notes, and snippets.


Joseph Spurrier josephspurrier

View GitHub Profile
josephspurrier / loadCSV.php
Last active May 8, 2021
Parse a CSV file in PHP, remove hidden characters, escape fields to prepare for MySQL, and return an associative array.
View loadCSV.php
// Auto detect line endings
ini_set('auto_detect_line_endings', true);
function loadCSV($file)
// Create an array to hold the data
$arrData = array();
// Create a variable to hold the header information
$header = NULL;
josephspurrier / values_pointers.go
Last active May 7, 2021
Golang - Asterisk and Ampersand Cheatsheet
View values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
Also available at:
p := Person{"Steve", 28} stores the value
josephspurrier / Dockerfile
Created Dec 3, 2020
AWS Lambda Container in Go
View Dockerfile
# Copy function code
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "hello" ]
josephspurrier / sshremote.go
Last active Apr 15, 2021
Golang Remote Execution
View sshremote.go
package main
// Example
sci := ServerConnInfo{
josephspurrier / structs_interface.go
Last active Apr 7, 2021
Golang - Understand Structs and Interfaces
View structs_interface.go
// Also available at:
package main
import (
// *****************************************************************************
// Example 1 - Struct vs Struct with Embedded Type
josephspurrier / aescmd.go
Created Dec 23, 2014
Golang - Encrypt, Decrypt, File Read, File Write, Readline
View aescmd.go
package main
import (
josephspurrier / bitmask.go
Last active Mar 13, 2021
Golang - Determine if bitmask is set
View bitmask.go
type Bitmask uint16
// BitValue is a value and a description
type BitValue struct {
josephspurrier / etc-init.d-hello-world
Last active Mar 6, 2021
/etc/init.d Script for Go Application
View etc-init.d-hello-world
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions
josephspurrier / extensions.json
Last active Feb 7, 2021
Visual Studio Code Settings
View extensions.json
"recommendations": [
josephspurrier / DefaultKeyBinding.Dict
Last active Feb 7, 2021
OS X Key Binding for Windows Keyboard
View DefaultKeyBinding.Dict
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems. This particular mapping assumes
that you have also switched the Control and Command keys already.
This key mapping is more appropriate after switching Ctrl for Command in this menu:
Apple->System Preferences->Keyboard & Mouse->Keyboard->Modifier Keys...->
Change Control Key to Command
Change Command key to Control