Skip to content

Instantly share code, notes, and snippets.

@Mattemagikern
Mattemagikern / Certificates.go
Created May 9, 2019
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
View Certificates.go
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@lmj0011
lmj0011 / rejson-for-ubuntu.md
Last active May 19, 2022
Building and Loading the ReJSON v1 Module on Linux Ubuntu 16.04 for Redis
View rejson-for-ubuntu.md

make sure you have at least redis v4.0+

redis-server --version

redis-cli --version

install the build-essential package

apt-get install build-essential

@sethvargo
sethvargo / create-certs.sh
Created Jun 6, 2018
Use openssl to create an x509 self-signed certificate authority (CA), certificate signing request (CSR), and resulting private key with IP SAN and DNS SAN
View create-certs.sh
# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${DIR}"
mkdir -p "${DIR}"
# Create the openssl configuration file. This is used for both generating
# the certificate as well as for specifying the extensions. It aims in favor
# of automation, so the DN is encoding and not prompted.
@malekpour
malekpour / Startup.cs
Last active May 30, 2020
Iris Go vs .NET Core Kestrel in terms of HTTP performance
View Startup.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Http;
@etenzy
etenzy / mvc.md
Last active May 17, 2021
MVC View Model Naming Conventions
View mvc.md
  • Model: Singular
  • View: Plural
  • Controller:
    • Plural: If your controller contains at least one action method that handles multiple entities at a single transaction. (resourceful)
    • Singular: example the AccountController is singular because it represents actions (action method) pertaining to a single account only.
  • Route: Plural
@teknoraver
teknoraver / unixhttpc.go
Last active Apr 3, 2022
HTTP over Unix domain sockets in golang
View unixhttpc.go
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@vitan
vitan / PriorityQueue_Multiple_producers_consumers.go
Last active Jan 23, 2022
PriorityQueue in golang, to support multiple producers and multiple consumers. with example how to use it
View PriorityQueue_Multiple_producers_consumers.go
package main
import (
"errors"
"fmt"
"math"
"reflect"
"sync"
)
@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active May 12, 2022
webRTC stun / turn server list
View gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@higebu
higebu / connect_with_specific_source_port.go
Created May 16, 2016
Golang: Connect with specific source port
View connect_with_specific_source_port.go
package main
import (
"bufio"
"fmt"
"log"
"net"
)
func main() {
@lopspower
lopspower / README.md
Last active May 24, 2022
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store