Skip to content

Instantly share code, notes, and snippets.

@xXPhenomXx
xXPhenomXx / launch.json
Created July 13, 2019 12:05
Vscode Golang/Revel Debug
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
"port": 2345,
package main
import (
"fmt"
"time"
"strings"
)
func main() {
@xXPhenomXx
xXPhenomXx / utc_to_cst.go
Created July 11, 2019 20:15
Convert UTC time to CST in Golang
// Handle UTC to CST conversion
loc, _ := time.LoadLocation("America/Chicago")
if err != nil {
fmt.Println(err)
}
dateAdded = dateAdded.In(loc)
p.DateAdded = dateAdded.Format("01/02/2006 03:04:05 PM")
@xXPhenomXx
xXPhenomXx / utc_to_cst.go
Created July 11, 2019 20:15
Convert UTC time to CST in Golang
// Handle UTC to CST conversion
loc, _ := time.LoadLocation("America/Chicago")
if err != nil {
fmt.Println(err)
}
dateAdded = dateAdded.In(loc)
p.DateAdded = dateAdded.Format("01/02/2006 03:04:05 PM")
@xXPhenomXx
xXPhenomXx / README-Template.md
Created June 19, 2018 14:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@xXPhenomXx
xXPhenomXx / server.conf
Created June 14, 2018 18:16 — forked from timcheadle/server.conf
SSL nginx config example
server {
listen 80;
server_name www.example.com example.com;
# Redirect all traffic to SSL
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl default_server;
@xXPhenomXx
xXPhenomXx / nginx-tls.conf
Created June 14, 2018 18:16 — forked from gavinhungry/nginx-tls.conf
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are omitted here.
#
# Example: https://www.ssllabs.com/ssltest/analyze.html?d=gavinhungry.io
#
<select class="form-control" data-placeholder="Choose a Category" tabindex="1" :selected="sState" v-model="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CT">Connecticut</option>
@xXPhenomXx
xXPhenomXx / GoMgoSample-1.go
Created March 8, 2018 15:17 — forked from 345161974/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@xXPhenomXx
xXPhenomXx / time_format.go
Created February 18, 2018 21:45 — forked from ik5/time_format.go
A full example of all possible time formats in Golang
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Times: ")
t := time.Now()