Skip to content

Instantly share code, notes, and snippets.

@pmaoui
pmaoui / Extractor.js
Created May 1, 2018 16:25
Extract key/value from JSON to a csv format.
const fs = require('fs');
const _ = require('lodash');
const dot = require('dot-object');
const [node, namefile, ...langs] = process.argv;
const separator = '";"';
const AllTrads = {};
const translations = [];;
@pmaoui
pmaoui / chart.js
Created September 21, 2018 12:08
Go JS Mapping chart
const $ = go.GraphObject.make; // for conciseness in defining templates
myDiagram = $(go.Diagram, 'myDiagramDiv', // must name or refer to the DIV HTML element
{
initialContentAlignment: go.Spot.Center,
layout: $(go.ForceDirectedLayout),
allowDelete: false,
allowCopy: false,
}
@pmaoui
pmaoui / merkle.sh
Created June 28, 2022 21:08
Merkle root of a bitcoin block calculated in bash
#!/bin/bash
# usage : ./merkel.sh tx1 tx2 ... txn
# better: ./merkel.sh $(bitcoin-cli getblock {hashOfABlock}|jq -rc '.tx[]')
function concat() {
echo -e "$1$2"
}