Skip to content

Instantly share code, notes, and snippets.

⌨️
keyboard shredding

Miguel Mota miguelmota

⌨️
keyboard shredding
Block or report user

Report or block miguelmota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miguelmota
miguelmota / gpg_github_setup.sh
Last active Jun 5, 2019
GPG (PGP) git commit message signing github setup to get verified label on commits
View gpg_github_setup.sh
# import a private key
gpg --import private.key
# or generate a new one with
gpg --default-new-key-algo rsa4096 --gen-key
# list key and copy key id
# example key id: 900F2297041DB47B1081911B67EC1161588A00F9
gpg --list-secret-keys --keyid-format LONG
@miguelmota
miguelmota / export.sh
Created Jun 4, 2019
GPG (PGP) export public key
View export.sh
# gpg --list-secret-keys --keyid-format LONG
gpg --armor --export 900F2297041DB47B1081911B67EC1161588A00F9
@miguelmota
miguelmota / import.sh
Created Jun 4, 2019
GPG (PGP) import private key
View import.sh
gpg --import private.key
View uninstall_truffle.sh
# https://ethereum.stackexchange.com/a/62956/5093
rm -f $(which truffle)
@miguelmota
miguelmota / github_subscribe_slash_command
Created Jun 3, 2019
Slack github slash command subscribe to everything (all branches, all commits, all issues, all pull requests, etc)
View github_subscribe_slash_command
/github subscribe org/repo issues pulls deployments statuses public commits commits:all releases comments branches reviews
@miguelmota
miguelmota / trim_bytes_slice.go
Created May 28, 2019
Golang trim control characters (NULL) from bytes slice
View trim_bytes_slice.go
package main
import (
"bytes"
"fmt"
)
func main() {
b := make([]byte, 100)
b[0] = 'A'
@miguelmota
miguelmota / deploy.sh
Created May 26, 2019
rsync upload (deploy) static website example
View deploy.sh
#!/bin/bash
hugo
rsync -avuz public/ --chmod=ugo=rwX root@example.com:/var/www/example/_site
@miguelmota
miguelmota / read_dir.go
Created May 22, 2019
Golang read list of files in directory
View read_dir.go
package main
import (
"fmt"
"io/ioutil"
"log"
)
func main() {
files, err := ioutil.ReadDir("./static/")
@miguelmota
miguelmota / graphql_query.js
Created May 18, 2019
Node GraphQL query example using fetch
View graphql_query.js
const fetch = require('node-fetch')
const query = `
query Echo($message:String) {
message: echo(message:$message)
}
`
const variables = {
message: 'hello'
You can’t perform that action at this time.