Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Glynn 17twenty

View GitHub Profile
@17twenty
17twenty / Makefile
Created Aug 22, 2013
Simple Misc Driver Example
View Makefile
# Simple Makefile to build a simple misc driver
# Nick Glynn <Nick.Glynn@feabhas.com>
#
obj-m += misc_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
CC := $(CROSS_COMPILE)gcc
View enumerated.go.tmpl
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 Jul 13, 2020
Creating and building an SEO strategy for your site
View SEO-Guide.md

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 / helloglib.c
Created Jan 14, 2014
Hello World using GLib
View helloglib.c
/*
* helloglib.c
* Using glib libraries to do a hello world
* Compile with:
* gcc helloglib.c `pkg-config --cflags --libs glib-2.0` -o helloglib
*/
#include <glib.h>
int
main (void)
@17twenty
17twenty / gist:2fb30a22141d84e52446
Created Feb 22, 2016
POST with NewRequest using Golang
View gist:2fb30a22141d84e52446
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
@17twenty
17twenty / jsonfilter.go
Last active Jul 2, 2020
JSONFilteredByWhitelist filters an incoming JSON payload against a while list then applies the filtered payload to the destination struct.
View jsonfilter.go
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
Snake To Camel and Camel To Snake Case In Go Golang
View camelsnake.go
package main
import (
"fmt"
"regexp"
"strings"
)
// Regex
@17twenty
17twenty / demo.go
Created May 21, 2020
Implementing Custom Marshal / Unmarshal for a custom type (and using an interface)
View demo.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"os"
"strconv"
)
@17twenty
17twenty / reader.go
Created May 19, 2020
CGo and Shared Memory
View reader.go
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;
You can’t perform that action at this time.