Skip to content

Instantly share code, notes, and snippets.

View aymericbeaumet's full-sized avatar
🔬
Experimenting

Aymeric Beaumet aymericbeaumet

🔬
Experimenting
View GitHub Profile
@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@LawJolla
LawJolla / gatsby-ssr.js
Created October 2, 2017 19:34
Gatsby + Apollo + Styled Components SSR
import React from "react";
import { renderToString } from "react-dom/server";
import ApolloClient, { createNetworkInterface } from "apollo-client";
import { ApolloProvider, getDataFromTree } from "react-apollo";
import { ServerStyleSheet, StyleSheetManager } from "styled-components";
// function to generate hydrated state for client side Apollo
function makeApolloState(ssrClient) {
const state = { apollo: ssrClient.getInitialState() }
// appends apollo state to the global client window object
@rjz
rjz / crypto-aes-256-gcm-demo.js
Last active June 1, 2025 00:27
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// The `iv` for a given key must be globally unique to prevent
@joyrexus
joyrexus / README.md
Last active June 12, 2025 20:55
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@xjdrew
xjdrew / client.go
Last active June 20, 2025 01:31
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@itod
itod / split_keyboards.md
Last active June 18, 2025 03:13
Every "split" mechanical keyboard currently being sold that I know of
@michaelficarra
michaelficarra / append-template-tag.js
Created May 30, 2016 14:29
chainable template tag for joining a bunch of strings over many lines
function append(separator) {
return typeof separator === "string" ? appender(separator, "") : appender("", "").apply(this, arguments);
}
function appender(separator, s) {
return function tag(literalParts, ...computedParts) {
s += literalParts[0];
for (let i = 1; i < literalParts.length; ++i) {
s += computedParts[i - 1] + literalParts[i];
}
@gianrubio
gianrubio / circle.yml
Last active December 17, 2023 22:01
Socks proxy to connect private hosts with circleci
machine:
services:
- docker
post:
- wget https://gist.githubusercontent.com/gianrubio/dce37ee9b9c024937832d776597e2603/raw/4cdb30e5075e8e6064ac48a258e05f518f8c88c0/circleci-tunnel.sh ~/ && chmod +x ~/circleci-tunnel.sh
- ~/circleci-tunnel.sh start:
background: true
@jim3ma
jim3ma / starttls_smtp_example.go
Last active March 9, 2025 00:09 — forked from chrisgillis/ssl_smtp_example.go
Golang StartTLS SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)