Skip to content

Instantly share code, notes, and snippets.

View 17twenty's full-sized avatar

Nick Glynn 17twenty

View GitHub Profile
@17twenty
17twenty / basic.css
Created July 31, 2021 04:54
Make your navbar change color on scroll
.nav {
transition-duration: 1s;
}
@17twenty
17twenty / generate.go
Created August 14, 2020 02:21
Generate an embeddable zip file that can be included in your Golang project that auto extracts at runtime.
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
)
func main() {
package {{.Package}}
import (
"database/sql/driver"
"encoding/json"
"fmt"
"strings"
)
// {{.Type}}Enum is the status code of an {{.Type}} (must be int64)
@17twenty
17twenty / SEO-Guide.md
Last active May 7, 2024 10:12
Creating and building an SEO strategy for your site

Hey guys!

There's a TON of content out there on SEO - guides, articles, courses, videos, scams, people yelling about it on online forums, etc etc..

Most of it, however, is super impractical. If you want to start doing SEO TODAY and start getting results ASAP, you'll need to do a TON of digging to figure out what's important and what's not.

So we wanted to make everyone's lives super easy and distill our EXACT process of working w/ clients into a stupid-simple, step-by-step practical guide. And so we did. Here we are.

A bit of backstory:

@17twenty
17twenty / jsonfilter.go
Last active July 2, 2020 05:10
JSONFilteredByWhitelist filters an incoming JSON payload against a while list then applies the filtered payload to the destination struct.
package types
import (
"encoding/json"
"io"
"reflect"
"strings"
)
// JSONFilteredByWhitelist filters an incoming JSON payload against a while list,
@17twenty
17twenty / camelsnake.go
Created May 26, 2020 07:58
Snake To Camel and Camel To Snake Case In Go Golang
package main
import (
"fmt"
"regexp"
"strings"
)
// Regex
@17twenty
17twenty / demo.go
Created May 21, 2020 07:40
Implementing Custom Marshal / Unmarshal for a custom type (and using an interface)
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"os"
"strconv"
)
@17twenty
17twenty / reader.go
Created May 19, 2020 01:54
CGo and Shared Memory
package main
// #include <stdlib.h>
// #include <string.h>
// #include <sys/shm.h>
// #include <sys/types.h>
// #include <stddef.h>
// int my_shm_open(char* filename, int open_flag){
// int shm_id;
// key_t key;
@17twenty
17twenty / the_marshal.go
Created May 7, 2020 07:28
Custom marshal/unmarshal leveraging Scan/Value() for JSON and Database usage
package main
import (
"database/sql/driver"
"encoding/json"
"fmt"
"strings"
)
type paymentOption int64
@17twenty
17twenty / accounting.go
Created March 2, 2020 03:16
Accounting and Formatting for Golang Shopspring decimal library
package quicka
import (
"fmt"
"strings"
"github.com/shopspring/decimal"
)
// FormatMoneyDecimal ...