Skip to content

Instantly share code, notes, and snippets.

View matheusd's full-sized avatar

Matheus Degiovani matheusd

View GitHub Profile
@matheusd
matheusd / ticketreport.md
Created September 5, 2018 12:30
Ticket Status Report

Procedure to generate a report on ticket status. You need access via rpc to a dcrd node and the jq tool installed.

This might take a long time to run if you have many tickets.

  1. Grab the list of transactions of the wallet:
$ dcrctl --wallet listtransactions "*" 999999999 > txs.txt
@matheusd
matheusd / fees.txt
Created September 3, 2018 12:09
Dump of fee estimator state for mainnet as of 2018-09-03
| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 30| 31| +Inf
0.00010000| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000 0.0| 0.00000000
#!/bin/sh
# Minimal tmux script to create a master dcrd simnet node + ticket
# bying wallet. Heavily based on davecgh script at:
# https://gist.github.com/davecgh/7bb5c995665787811dc6a6ddbb49688d
set -e
SESSION="dcrd-fees"
NODES_ROOT=~/dcrdsimnetnodes
RPCUSER="USER"
@matheusd
matheusd / bookmarklet.js
Created November 14, 2017 13:09
Improve Github PR inputs
// This is a bookmarklet to improve github's PR inputs (the PR title and PR comment)
// This adds a maxlength of 50 to the PR title and changes the comment to use a
// monospaced font.
//
// To use it, add a bookmark to your browser's bookmark bar and copy the following
// line as its content.
javascript:(function(){document.getElementById("pull_request_title").maxLength = 50; document.getElementById("pull_request_body").style.fontFamily = 'Mono' ; document.getElementById("pull_request_body").parentNode.style.backgroundColor = "#ffffc0" })()
@matheusd
matheusd / vid2gif.sh
Created October 3, 2017 17:17
ffmpeg script to convert mp4 to gif
#!/bin/sh
# Use as ./vid2gif.sh <filename.mp4>
SRC=$1
DST="$1.gif"
ffmpeg -y -i $SRC -vf fps=10,scale=1280:-1:flags=lanczos,palettegen palette.png
ffmpeg -y -i $SRC -i palette.png -filter_complex "fps=10,scale=1280:-1:flags=lanczos[x];[x][1:v]paletteuse" $DST
@matheusd
matheusd / autoclick
Created August 31, 2017 11:09
A bash autoclicker using xdotool (clicks automatically after moving the mouse)
#!/bin/bash
# Bash Autoclicker
# Simulates key presses automatically when the mouse is moved
# Written by matheusd.com
# License: Public
((OLDX=0))
((OLDY=0))
((LIMIT = 4 * 4))
#!/bin/bash
DEVICE=$1
TARGETVM=$2
USB_DEVICE=`qvm-usb |grep $DEVICE |cut -f1`
# Is it already attached
qvm-usb |grep $USB_DEVICE | grep "(attached to "
if [ $? -eq 0 ]; then
echo "detatching $DEVICE"
qvm-usb -d $USB_DEVICE
@matheusd
matheusd / MDWSLoader.js
Created May 24, 2017 20:25
Optimzed CSS download for my website
/** My dynamic CSS loader for embedding. */
(function () {
var MDWSLoader = {
/** Sets the CSS files used by the system. */
setCSS: function (files) {
this.cssFiles = files;
},
/** Load the css files using document.write(link...). */
@matheusd
matheusd / unDebugUnitInitOrder.pas
Created December 15, 2016 08:44
Unit para depuração da ordem de carregamento de units de um programa Delphi
unit unDebugUnitInitOrder;
interface
uses
Windows, SysUtils, Classes, Forms, StrUtils, JclDebug;
procedure extractUnitOrder;
implementation
@matheusd
matheusd / sistema.dpr
Created December 15, 2016 08:26
Exemplo de programa instrumentado com a UnPerfCounter.pas
program sistema;
uses
unPerfCounter,
Forms,
Unit1 in 'Unit1.pas' {Form1},
//...
Unit1000 in 'Unit1000.pas' {Form1000};
{$R *.RES}