Skip to content

Instantly share code, notes, and snippets.

View Asone's full-sized avatar
🦀
npub10fd0ncqmzd6q3e7t9kzlh82asw2jj7kpn7hjvcrfhq4uyzc4dpvsxtvn3n

Asone

🦀
npub10fd0ncqmzd6q3e7t9kzlh82asw2jj7kpn7hjvcrfhq4uyzc4dpvsxtvn3n
View GitHub Profile
WITH content_tags AS (
SELECT
json_extract(content,'$.tags') AS elements,
lower(hex(event_hash)) AS hash,
e.created_at AS reported_at
FROM event AS e
WHERE kind = 1984 AND e.created_at >= $__from / 1000 and e.created_at < $__to / 1000
)
SELECT
@Asone
Asone / dashboard.json
Created October 5, 2023 07:11
Grafana dashboard configuration for nostr-rs-relay monitoring
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
{
"stats": [{
"nombre_transactions": 0,
"ts": "2019-01-01T00:00:00+01:00",
"valeur_medianne": null,
"valeur_medianne_btc": null,
"valeur_medianne_surface_unitaire_btc": null,
"valeur_moyenne": null,
"valeur_moyenne_btc": null,
"valeur_moyenne_surface_unitaire": null,
{
"stats": [{
"nombre_transactions": 2404,
"ts": "2019-01-01T00:00:00+01:00",
"valeur_medianne": 225000.0,
"valeur_medianne_btc": 70.7936503306469,
"valeur_medianne_surface_unitaire_btc": 1.29596187697279,
"valeur_moyenne": 382991.237882696,
"valeur_moyenne_btc": 3183.99430761582,
"valeur_moyenne_surface_unitaire": 5851.35876241417,
{
"stats": [{
"nombre_transactions": 942,
"ts": "2020-01-01T00:00:00+01:00",
"valeur_medianne": 208350.0,
"valeur_medianne_btc": 26.5752761197884,
"valeur_medianne_surface_unitaire_btc": 0.288323650945224,
"valeur_moyenne": 270081.057802548,
"valeur_moyenne_btc": 7730.78621761706,
"valeur_moyenne_surface_unitaire": 2941.94656890132,
@Asone
Asone / .tmux.conf
Created December 20, 2019 11:04
Tmux config
# ==========================
# === General settings ===
# ==========================
set -g default-terminal "screen-256color"
set -g history-limit 20000
set -g buffer-limit 20
set -sg escape-time 0
set -g display-time 1500
set -g remain-on-exit off
Account {
address: '<my0xedAddress>',
privateKey:
'<myPrivateKey>',
accounts:
TransactionSigner {
utils:
{ randomHex: [Function: randomHex],
jsonInterfaceMethodToString: [Function: jsonInterfaceMethodToString],
@Asone
Asone / derouleur.d.ts
Created September 18, 2018 23:16
Extraction d'interfaces typescript sur la base d'un échantillon issu du dérouleur de l'assemblée nationale
export interface Welcome {
racine: Racine;
}
export interface Racine {
jaune: Jaune;
contenu: Contenu;
}
export interface Contenu {
{
scrutins{
dateScrutin
titre
demandeur{
referenceLegislative
}
numero
sort{
@Asone
Asone / instance.ts
Last active February 1, 2018 10:32
Create an instance of smart-contract to interact with when contract address is not already specified
// this is useful when you have to interact with contract instanciated on-the-go from another contract and can't use the deployed() method of truffle-contract
/**
*
* @ABIJSON : a JSON object representing the ABI file ( mostly generated with a solidity compiler or a deployment framework ( embark / truffle )
* @nodeEntryPoint : node of the ETH chain to interact with
* @scDeployedAddress : Address of the contract to interact with
* @myMethod : Method of the smart contrac to call
* @arg1,arg2,argN : some arguments for the method.
* @signatureAddress : address originating the transaction
* @maxGas : gas that will be provided for the transaction. If can't be determined in advance, should be quite large, moreover if you plan to call a method that itself will deploy another contract