Skip to content

Instantly share code, notes, and snippets.

View consensus-jwt.configmap.yaml
apiVersion: v1
data:
beacon-jwt-secret: <secret, can be generated with `cat /dev/urandom | head -c 32 | to_hex -in`>
kind: ConfigMap
metadata:
name: consensus-jwt
namespace: <namespace>
@maoueh
maoueh / block.json
Created Apr 13, 2022
Block The Graph
View block.json
{
"ver": 1,
"hash": "UYr/kcNniZ6ONwDabkOUC7Ql1lg2p+ybozcmooMHZNA=",
"number": "11235113",
"size": "39368",
"header": {
"parentHash": "t4KICcevrY0uGdxPOvonOoU3jO9jit6Z+N4fSxkLCOM=",
"uncleHash": "HcxN6N7HXXqrhbVntszUGtMSRRuUinQT8KFC/UDUk0c=",
"coinbase": "6mdP3ecU/Zed4+3w9WqpcWuJjsg=",
"stateRoot": "xcqfE5cbaWTy6LEjfYGrsTG1uIynNb5d9CelSMJHrUA=",
View gist:cccb6099dadf6198a17a5b5562735954
TsvHttpData-1.0
https://near-protocol-public.s3-accelerate.amazonaws.com/backups/testnet/archive/data.tar 3026181378048
@maoueh
maoueh / print.go
Last active Nov 13, 2020
A `*query.Document` printer for https://github.com/graph-gophers/graphql-go library (internal work)
View print.go
package query
// Goes in internal/query/print.go
import "fmt"
func PrintGraphQLDocument(document *Document) {
if document == nil {
fmt.Println("Document <nil>")
return
@maoueh
maoueh / index.js
Last active Aug 29, 2019
A quick script to play with Promise nesting and resolution (node index.js)
View index.js
function buildPromise(tag, shouldError) {
if (shouldError) {
return new Promise((resolve, reject) => {
console.log(tag + " executor")
setTimeout(() => { console.log(tag + " rejecting!"); reject(tag + " failed on purpose") }, 250)
})
}
return new Promise((resolve, reject) => {
console.log(tag + " executor")
@maoueh
maoueh / shellscript.json
Last active Jun 21, 2019
VS Code Shellscript Snippets for a Bash Boilerplate script (developer script)
View shellscript.json
{
"Bash script boilerplate": {
"prefix": "bshb",
"body": [
"#!/usr/bin/env bash",
"",
"ROOT=\"$( cd \"$( dirname \"\\${BASH_SOURCE[0]\\}\" )\" && pwd )\"",
"",
"main() {",
" current_dir=\"`pwd`\"",
@maoueh
maoueh / main.go
Last active Aug 18, 2022
golang gorilla mux sub/router + specific middleware per subrouter
View main.go
package main
import (
"time"
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
View shell find Kodi MySQL videos duplicate
##
# From shell command line, with a MySQL database dump of the videos database, this
# shell command line will print all the duplicates duplicate string.
#
# Replace the `<...>` string by actual values for your system. Also, I use
# hard-coded IP in my database which result in the used Regex
# (`"'smb://.+?/.+?\.([a-zA-Z0-9]+)'"`). It's general enough but you might need
# to update it to your needs.
#
# OS: Mac OS X (10.11.6)
View Test bitrise docker install env
docker_test:
steps:
- git::https://github.com/samsao/bitrise-step-macos-install-docker.git@feature/auto-export:
title: Install Docker
- script@1.1.3:
title: Build image
inputs:
- content: |-
#!/bin/bash
set -ex
@maoueh
maoueh / Uris.java
Created Aug 24, 2016
Simple Uris Java helper
View Uris.java
import java.net.URI;
import java.net.URISyntaxException;
/**
* Unlicense granted <http://unlicense.org>
*/
public final class Uris {
/**
* An unchecked version of the {@link URI#URI(String)} construction, i.e. a version that does not throw {@link