Skip to content

Instantly share code, notes, and snippets.

@chrisnc
chrisnc / rawudp.go
Last active April 7, 2025 13:30
constructing ip/udp packets in go
package main
import (
"bufio"
"bytes"
"encoding/binary"
"flag"
"fmt"
"net"
"os"
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@alexedwards
alexedwards / gist:dc3145c8e2e6d2fd6cd9
Last active March 3, 2025 15:05
Example of working with Go's database/sql and NULL fields
CREATE TABLE books (
isbn char(14) NOT NULL,
title varchar(255),
author varchar(255),
price decimal(5,2)
);
INSERT INTO books (isbn, title, author, price) VALUES
('978-1503261969', 'Emma', 'Jayne Austen', 9.44),
('978-1514274873', 'Journal of a Soldier', NULL, 5.49),
@denji
denji / golang-tls.md
Last active April 17, 2025 21:33 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@DmitrySoshnikov
DmitrySoshnikov / es6-delegating-generator.js
Last active April 7, 2018 12:31
ES6 delegating generator
/**
* ES6 delegating generators.
*
* ES6 dramatically simplified calling of nested generators
* using "yield *" construct, which is called delegating
* generator.
*
* From history:
* Previously (in the original SpiderMonkey/Python) implementation
* we had to maintain a manual stack for it. The technique was
@zubietaroberto
zubietaroberto / main.go
Created October 22, 2014 18:27
Golang UDP Socket Server
/*
This script creates a simple UDP Server that exports all data received
through the 8080 socket into the console.
Made By: Roberto E. Zubieta
Panama City, Panamá
G+: https://plus.google.com/u/0/105524772414753584405/
*/
package main
@dwayne
dwayne / 0-intro.md
Last active June 18, 2024 07:12
My notes from the book "Authority by Nathan Barry".

A Step-By-Step Guide To Self-Publishing

Become an expert, build a following, and gain financial independence.

by Nathan Barry

Table of Contents

@andreagrandi
andreagrandi / parse_json_post.go
Created August 19, 2014 13:28
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
@kevincennis
kevincennis / v8.md
Last active March 6, 2025 22:24
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing