Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Marshall jmshal

View GitHub Profile
@jmshal
jmshal / main.go
Created Jun 11, 2019 — forked from julz/main.go
containersched minicontainer
View main.go
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
View Setting up Docker Machine on Raspberry PI.md

#Setting up Docker Machine on Raspberry PI

  1. SSH into the pi and install docker with curl -sSL https://get.docker.com | sh (If we let Machine try to install the Docker daemon it will fail.)
  2. Change the OS's ID so Docker Machine won't throw errors. sudo nano /etc/os-release and change the line that says ID=raspbian to ID=debian
  3. From a new terminal window run docker-machine create --driver generic --generic-ip-address YOUR-PIS-IP --generic-ssh-key ~/.ssh/id_rsa --generic-ssh-user pi --engine-storage-driver overlay2 MACHINE-NAME
@jmshal
jmshal / coverage.js
Created Feb 26, 2018 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
View coverage.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*
* Shows how to use Puppeeteer's code coverage API to measure CSS/JS coverage across
* different points of time during loading. Great for determining if a lazy loading strategy
* is paying off or working correctly.
*
* Install:
* npm i puppeteer chalk cli-table
View azure-cli.sh
#!/usr/bin/env bash
AZ_PATH=$HOME
AZ_CONTAINER_NAME=azure-cli
AZ_IMAGE_TAG=azure-cli
az() {
docker exec -it $AZ_CONTAINER_NAME az "${@}"
}
View gist:b1e61e5c5e69df0ed8bfa43244e84609
### Keybase proof
I hereby claim:
* I am jmshal on github.
* I am jacobmarshall (https://keybase.io/jacobmarshall) on keybase.
* I have a public key ASBdZfaTpvmwq2rZO8iATSvFIJtC36pAgIYJlx20yL-osQo
To claim this, I am signing this object:
@jmshal
jmshal / main.go
Created Jun 29, 2017 — forked from manishtpatel/main.go
GoLang Encrypt string to base64 and vice versa using AES encryption.
View main.go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@jmshal
jmshal / golang-tls.md
Created Jun 21, 2017 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
View golang-tls.md

Moved to git repository: https://github.com/denji/golang-tls

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)
@jmshal
jmshal / AWS Swarm cluster.md
Created Jan 14, 2017 — forked from ghoranyi/AWS Swarm cluster.md
Create a Docker 1.12 Swarm cluster on AWS
View AWS Swarm cluster.md

This gist will drive you through creating a Docker 1.12 Swarm cluster (with Swarm mode) on AWS infrastructure.

Prerequisites

You need a few things already prepared in order to get started. You need at least Docker 1.12 set up. I was using the stable version of Docker for mac for preparing this guide.

$ docker --version
Docker version 1.12.0, build 8eab29e

You also need Docker machine installed.

@jmshal
jmshal / README.md
Last active May 15, 2018
Electron `position: sticky` shim
View README.md

electron-sticky-shim

This 8 line shim makes elements with position: sticky work as intended in situations where you have scrollable content nested within your app - see this for an example.

Installation

You can either copy the sticky-shim.js file from this gist, or install it as a module using npm...

$ npm install --save gist:4c7dd81a61adcb648944a16b0fac717f
@jmshal
jmshal / atob.js
Last active Jul 9, 2021
Node.js ponyfill for atob and btoa encoding functions
View atob.js
module.exports = function atob(a) {
return new Buffer(a, 'base64').toString('binary');
};