Skip to content

Instantly share code, notes, and snippets.

View p4tin's full-sized avatar
💭
GO GO GO!!!

Paul Fortin p4tin

💭
GO GO GO!!!
View GitHub Profile
@p4tin
p4tin / sqsQueueUtil.go
Last active August 1, 2022 03:45
Simple Utility to access Amazon SQS (or local ElasticMQ) using Go
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/sqs"
"os"
"flag"
)
@p4tin
p4tin / Mongo.go
Created December 13, 2015 18:06
Golang Mongo CRUD Example
package mongo
import (
"time"
"log"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// Profile - is the memory representation of one user profile
@p4tin
p4tin / genPass.go
Last active December 13, 2015 18:34
Golang Generate Passwords
package main
import (
"fmt"
"strings"
"bytes"
"github.com/Pallinder/go-randomdata"
)
func main() {
@p4tin
p4tin / generate_data.go
Created December 13, 2015 21:25
Demo the use of the github.com/Pallinder/go-randomdata
package main
import (
"fmt"
"github.com/Pallinder/go-randomdata"
)
func main() {
// Print a random silly name
fmt.Println(randomdata.SillyName())
@p4tin
p4tin / aes.key
Last active December 13, 2015 22:36
Demo of Data Encrypt/Decrypt with AES 256 Key
jHa1bVPQeck+3AsZJa9exEBcI9Pe40XvNSMsezaRr2c=
"""
Map oplog to you custom interface. To, for example, have triggers in mongo.
see example in '__main__' below
https://gist.github.com/rescommunes/4e5035242b8e4b07ff3a
"""
import logging
from time import sleep
import pickle
@p4tin
p4tin / text_adv-part-1.go
Last active September 24, 2024 14:38
Writing a Text Adventure Game in Go - Part 1
package main
import (
"fmt"
"math/rand"
"time"
)
type Game struct {
Welcome string
@p4tin
p4tin / handlers_test.go
Created March 22, 2016 17:27
Testing Http Handlers in GO
package main
import (
"net/http"
"testing"
"net/http/httptest"
)
func TestHealthCheckHandler(t *testing.T) {
// Create a request to pass to our handler. We don't have any query parameters for now, so we'll
package main
import (
"fmt"
"math/rand"
"os"
"sort"
"time"
)
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
var Out *os.File