Skip to content

Instantly share code, notes, and snippets.

View jboursiquot's full-sized avatar
👾

Johnny Boursiquot jboursiquot

👾
View GitHub Profile
@jboursiquot
jboursiquot / tns-go-1.go
Last active August 8, 2024 17:24
TNS Go samples
// Variable Declaration: Go supports both explicit and implicit variable declaration.
// Explicit declaration requires specifying the type, while implicit declaration uses type inference.
// Example of explicit declaration:
var message string = "Hello, Go!" // explict type specified
// Example of implicit declaration:
count := 42
// Functions: Functions in Go are defined using the func keyword.
@jboursiquot
jboursiquot / gophercon-go-for-experienced-programmers.md
Last active July 6, 2024 07:09
GopherCon 2024 - Go for Experienced Programmers Workshop Prep

GopherCon 2024 - Go For Experienced Programmers pre-workshop preparations

Hello fellow Gophers!

In preparation for the workshop, you'll need to download and install some tools ahead of time so save bandwith and have everything you need to follow along during our time together.

Docker

You'll need Docker Desktop installed: https://www.docker.com/products/docker-desktop/

@jboursiquot
jboursiquot / gopherconeu.workshop.md
Last active July 6, 2024 07:10
GopherCon Europe 2024 - Go For Experienced Programmers pre-workshop preparations

GopherCon Europe 2024 - Go For Experienced Programmers pre-workshop preparations

Hello fellow Gophers!

In preparation for the workshop, you'll need to download and install some tools ahead of time so save bandwith and have everything you need to follow along during our time together.

Docker

You'll need Docker Desktop installed: https://www.docker.com/products/docker-desktop/

@jboursiquot
jboursiquot / sql.sql
Created July 17, 2023 00:05
pgsql list size on disk of all tables
SELECT
table_schema || '.' || table_name AS table_full_name,
pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) AS size
FROM information_schema.tables
ORDER BY
pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') DESC;
@jboursiquot
jboursiquot / point.go
Created March 6, 2023 19:11
Solution
package main
import (
"math"
)
type Point struct {
Val float64
Ts uint32
}

Capstone Project

Summary

The capstone project outlined here will be to create a CLI tool (named ziplook) that, given a postal code, opens a browser that takes the user to Google Maps and drops a pin at the latitude and longitude of said postal code. The project will involve creating a API server for the CLI to interact with. The API will be hosted online using a third party Platform as a Service (PaaS) provider (Zeet) and be reacheable by issuing HTTP GET requests (no authorization required).

I will demonstrate the following:

  1. Building a REST API in Go
  2. Integrating with a remote API (https://api.zippopotam.us)
@jboursiquot
jboursiquot / products.json
Created October 27, 2022 22:51
Sample products dataset
[{
"id": 1,
"name": "Water - San Pellegrino",
"description": "curae nulla dapibus dolor vel est donec odio justo sollicitudin ut suscipit a feugiat et eros vestibulum ac est lacinia",
"price": 80
}, {
"id": 2,
"name": "Cape Capensis - Fillet",
"description": "rutrum neque aenean auctor gravida sem praesent id massa id nisl venenatis lacinia aenean sit amet justo morbi ut odio",
"price": 53
@jboursiquot
jboursiquot / sample.json
Created October 24, 2022 21:35
Sample json data
{
"name": "Johnny Boursiquot",
"location": "Baltimore, MD"
}
@jboursiquot
jboursiquot / generics.md
Last active July 21, 2022 15:56
Generics in 2 Hours

Generics in 2 Hours

Starting with version 1.18, Go supports the concept of generic programming through the introduction of three major concepts to the language:

  • Type parameterization of functions and types
  • Type sets defined by interfaces
  • Type inference

Let's see how these feature enable us to write less code while still retaining the simplicity we've come to expect of Go.

@jboursiquot
jboursiquot / practical-go-prereqs.md
Last active May 26, 2021 16:41
Practical Go workshop prerequisites

Practical Go Workshop Prerequisites

Thanks again for signing up for the workshop. There's a lot to cover and we'll need to hit the ground running on time so it's important that you arrive prepared with all you'll need locally already configured and ready to go.

TL;DR

  • Have Git installed
  • Have Go 1.13+ installed
  • Have an editor/IDE with Go plugin installed.
  • Have some basic familiarity with Go, use gobyexample.com if you need a refresher or introduction.