Skip to content

Instantly share code, notes, and snippets.

View gspencerfabian's full-sized avatar
:octocat:
Working...

G Spencer Fabian gspencerfabian

:octocat:
Working...
View GitHub Profile
@gspencerfabian
gspencerfabian / websocket_example.go
Last active May 30, 2022 04:30
Golang WebSocket HTTP Middleware Example
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"github.com/gorilla/websocket"
@gspencerfabian
gspencerfabian / main.go
Created September 8, 2015 04:19
golang - example switch statement
package main
import (
"fmt"
"os"
"strconv"
)
var arg1 = os.Args[1]
var arg2 = os.Args[2]
@gspencerfabian
gspencerfabian / home.html
Last active April 11, 2020 19:07
golang - post json contact form and email send from html template
{{define "home"}}
<html>
<head>
<title>Hello World</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<h2>Welcome!</h2>
<p>Please fill out the following contact form</p>
<form id="contactForm">