Skip to content

Instantly share code, notes, and snippets.

View maoueh's full-sized avatar

Matthieu Vachon maoueh

View GitHub Profile
@maoueh
maoueh / test-cloud-init-run.sh
Created June 2, 2016 14:28
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
@maoueh
maoueh / Uris.java
Created August 24, 2016 17:28
Simple Uris Java helper
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
docker_test:
steps:
- git::https://github.com/samsao/bitrise-step-macos-install-docker.git@feature/auto-export:
title: Install Docker
- [email protected]:
title: Build image
inputs:
- content: |-
#!/bin/bash
set -ex
##
# 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)
@maoueh
maoueh / main.go
Last active September 8, 2024 17:50
golang gorilla mux sub/router + specific middleware per subrouter
package main
import (
"time"
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
@maoueh
maoueh / shellscript.json
Last active June 21, 2019 14:53
VS Code Shellscript Snippets for a Bash Boilerplate script (developer script)
{
"Bash script boilerplate": {
"prefix": "bshb",
"body": [
"#!/usr/bin/env bash",
"",
"ROOT=\"$( cd \"$( dirname \"\\${BASH_SOURCE[0]\\}\" )\" && pwd )\"",
"",
"main() {",
" current_dir=\"`pwd`\"",
@maoueh
maoueh / index.js
Last active August 29, 2019 07:38
A quick script to play with Promise nesting and resolution (node 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 / print.go
Last active November 13, 2020 04:18
A `*query.Document` printer for https://github.com/graph-gophers/graphql-go library (internal work)
package query
// Goes in internal/query/print.go
import "fmt"
func PrintGraphQLDocument(document *Document) {
if document == nil {
fmt.Println("Document <nil>")
return
TsvHttpData-1.0
https://near-protocol-public.s3-accelerate.amazonaws.com/backups/testnet/archive/data.tar 3026181378048
@maoueh
maoueh / block.json
Created April 13, 2022 17:29
Block The Graph
{
"ver": 1,
"hash": "UYr/kcNniZ6ONwDabkOUC7Ql1lg2p+ybozcmooMHZNA=",
"number": "11235113",
"size": "39368",
"header": {
"parentHash": "t4KICcevrY0uGdxPOvonOoU3jO9jit6Z+N4fSxkLCOM=",
"uncleHash": "HcxN6N7HXXqrhbVntszUGtMSRRuUinQT8KFC/UDUk0c=",
"coinbase": "6mdP3ecU/Zed4+3w9WqpcWuJjsg=",
"stateRoot": "xcqfE5cbaWTy6LEjfYGrsTG1uIynNb5d9CelSMJHrUA=",