Skip to content

Instantly share code, notes, and snippets.

View j-chimienti's full-sized avatar
🎯
Focusing

Joe j-chimienti

🎯
Focusing
View GitHub Profile
FEES_COLLECTED=$(lightning-cli getinfo | jq '.msatoshi_fees_collected / 1000')
AVERAGE_FORWARDED=$(lightning-cli listforwards | jq '.forwards[] | select (.status == "settled") | .in_msatoshi' | jq -s 'add / length / 1000')
PAYMENTS_FORWARDED=$(lightning-cli listforwards | jq '.forwards[] | select (.status == "settled") | .in_msatoshi' | jq -s 'length')
echo "Payments forwarded: $PAYMENTS_FORWARDED"
echo "Average payment forwarded: $AVERAGE_FORWARDED satoshi"
echo "Fees collected: $FEES_COLLECTED satoshi"
pragma solidity ^0.4.7;
contract CommitRevealElection {
// The two choices for your vote
string public choice1;
string public choice2;
// Information about the current status of the vote
uint public votesForChoice1;
uint public votesForChoice2;
@jgrodziski
jgrodziski / docker-aliases.sh
Last active April 24, 2024 17:41
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4
@vitalymak
vitalymak / bluebird-map-vs-all.js
Created August 24, 2016 13:22
Bluebird's promise map vs all difference
const Promise = require('bluebird');
const list = [300, 500, 400]
const getMapper = name =>
ms => Promise.delay(ms).then(() => console.log(`${name}: ${ms}ms done in ${Date.now() - start}`));
const start = Date.now();
Promise.map(list, getMapper('map, infinity concurrency'));