Skip to content

Instantly share code, notes, and snippets.

View axeldeau's full-sized avatar
👉
#BlackLivesMatter

Axel DEAU axeldeau

👉
#BlackLivesMatter
  • Crossfire Corp.
  • Montreal, Quebec, Canada
View GitHub Profile
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@rcrowley
rcrowley / grace.go
Last active March 1, 2023 16:06
Graceful stop in Go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
@josephspurrier
josephspurrier / aescmd.go
Created December 23, 2014 07:11
Golang - Encrypt, Decrypt, File Read, File Write, Readline
package main
import (
"bufio"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
@subfuzion
subfuzion / curl.md
Last active July 18, 2024 17:12
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@turtlemonvh
turtlemonvh / Makefile
Last active January 23, 2024 03:33
Golang Project Makefile Template
# Borrowed from:
# https://github.com/silven/go-example/blob/master/Makefile
# https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BINARY = superdo
VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64
VERSION?=?
@boiyama
boiyama / docker-compose.yml
Created April 6, 2017 07:34
docker-compose.yml configuring GitLab with Container Registry, Pages, CI, and Mattermost
version: '2'
services:
gitlab:
container_name: gitlab
image: gitlab/gitlab-ce:latest
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
## GitLab configuration settings
##! Check out the latest version of this file to know about the different
@nstogner
nstogner / retry_http.go
Last active March 19, 2023 03:29
Go: Simple retry function (HTTP request)
// DeleteThing attempts to delete a thing. It will try a maximum of three times.
func DeleteThing(id string) error {
// Build the request
req, err := http.NewRequest(
"DELETE",
fmt.Sprintf("https://unreliable-api/things/%s", id),
nil,
)
if err != nil {
return fmt.Errorf("unable to make request: %s", err)
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 22, 2024 10:08
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@elifiner
elifiner / -first-last-names.md
Last active April 4, 2024 19:37
List of first names and last names for random data generation

First and last names

This gist has two files in it: first-names.txt and last-names.txt, each with 4096 names taken from some unnamed database.

Useful for generating mock data for testing or for opfuscating production data for testing.

See https://stackoverflow.com/a/50242368/15109 for some thoughts about data obfuscation.

Visual Studio Code C/C++ Propeties files for UE 4.20

Version 4.20 of Unreal Engine does not generate includes for *.generated.h files. To fix this, you must modify your c_cpp_properties.json.

  1. Create an environment variables called UNREAL_ENGINE pointing to the Unreal Engine folder (UE_4.20 for example) with no trailing backslash.
  2. Replace your c_cpp_propeties.json with the one below.

Other intellisense issues

Visual Studio Code seems to not understand Include-What-You-Use style headers. To fix this, replace #include "CoreMinimal.h" and any other Unreal system includes with #include "Engine.h". This should fix Intellisense errors, at the cost of some initial compile time.