Skip to content

Instantly share code, notes, and snippets.

View vincenzopalazzo's full-sized avatar
:octocat:
The commit can contain poetry

Vincenzo Palazzo vincenzopalazzo

:octocat:
The commit can contain poetry
View GitHub Profile
@vincenzopalazzo
vincenzopalazzo / Material-ui-Swing_debug.md
Created April 16, 2020 18:04
Contains some information about the debug of material-ui-swing library

Material-UI-Swing debugging

Introductions

TODO

What version of library should be used?

Material-ui-swing implement a debug version with SLF4J that create a file inside you home dir called material-debug.log but if your problem need time to reproduce, this version is not good, because at the moment there isn't a softwer GUI to see the debug log for big file.

Example of jatJar task using Gradle Kotlin DSL:

val mainClass = "com.github.daggerok.Main" // replace it!

tasks {
  register("fatJar", Jar::class.java) {
    archiveClassifier.set("all")
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
 manifest {
@vincenzopalazzo
vincenzopalazzo / lab_report.tex
Created October 1, 2020 11:12 — forked from balos1/lab_report.tex
A Lab Report LaTex Template
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% University/School Laboratory Report
% LaTeX Template
% Version 3.1 (25/3/14)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Linux and Unix Users Group at Virginia Tech Wiki
@vincenzopalazzo
vincenzopalazzo / pytest-fixture-modularization.md
Created October 26, 2020 08:40 — forked from peterhurford/pytest-fixture-modularization.md
How to modularize your py.test fixtures

Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.

Turns out, however, you can define fixtures in individual files like this:

tests/fixtures/add.py

import pytest

@pytest.fixture
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
bitcoin_version="bitcoin-0.20.0"
lightning_version="clightning-v0.9.2"
#Path Bitcoin core
export PATH=$PATH:/home/vincent/Bitcoin/$bitcoin_version/bin/
#Path C-lightninh
export PATH=$PATH:/home/vincent/Bitcoin/$lightning_version/bin/
@vincenzopalazzo
vincenzopalazzo / spacemacs-keybindings.md
Created January 15, 2021 19:37 — forked from rnwolf/spacemacs-keybindings.md
spacemacs keybindings that i need to learn
@vincenzopalazzo
vincenzopalazzo / segment_tree.mc
Created February 7, 2021 18:26
Segment tree data structure implementation with MicroC language developer to test an academics compiler of Master class the compiler is available on Docker Hub https://hub.docker.com/repository/docker/vincenzopalazzo/microclang
/**
* Segment tree data structure implementation with MicroC language
* developer to test an academics compiler of Master class
* The compiler is available on Docker Hub
* https://hub.docker.com/repository/docker/vincenzopalazzo/microclang
*
* Copyright (C) 2021 Vincenzo Palazzo vincenzopalazzodev@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@vincenzopalazzo
vincenzopalazzo / DoubleSha256.py
Created March 24, 2019 19:14
The python script for calculate a double sha256 for block and transaction
from binascii import unhexlify
from hashlib import sha256
header = unhexlify("0101000000010000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000")
print(sha256(sha256(header).digest()).hexdigest())
@vincenzopalazzo
vincenzopalazzo / bitcoin-hash-public-key.cpp
Created February 24, 2020 11:54
This is code implemented inside the Bitcoin stack aswer
/**
* Convert array bytes to string.
**/
std::string ToString(uint8_t bytes[Ripemd160::HASH_LEN]){
std::string hashResult;
std::stringstream stream;
for(int i = 0; i < Ripemd160::HASH_LEN; i++){
int valueInt = static_cast<int>(bytes[i]);
stream << std::hex << std::setprecision(2) << std::setw(2) << std::setfill('0') << valueInt;
}