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 / SwingFXWebView.java
Created February 19, 2019 16:03 — forked from anjackson/SwingFXWebView.java
Embedding a JavaFX WebView in a Swing panel.
import com.sun.javafx.application.PlatformImpl;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
import javafx.scene.Node;
@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 / ListUIDefaultsKeys.java
Created May 28, 2019 22:39 — forked from itzg/ListUIDefaultsKeys.java
Java Swing UIDefaults keys
import java.util.Enumeration;
import java.util.SortedSet;
import java.util.TreeSet;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
public class ListUIDefaultsKeys {
public static void main(String args[]) throws Exception {
UIManager.LookAndFeelInfo looks[] = UIManager
@vincenzopalazzo
vincenzopalazzo / mining-bitcoin-ends-year.py
Last active September 6, 2019 18:59
This code calculate the year in which the bitcoin mining ends
def calculatesYear():
numbersBlock = 0
blockToHeaving = 210000
starYear = 2008
buildBitcoin = 50
print("-------- Value to start ----------")
print("Num. block: ", numbersBlock)
print("Num. Block: ", blockToHeaving)
print("Miner build bitcoin: ", buildBitcoin)
@vincenzopalazzo
vincenzopalazzo / GUIBitcoinCoreAmmountAddress.py
Created September 6, 2019 21:22
Simple Console gui bitcoin core for calculate the amount on the an address
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
rpc_user = 'vincent'
rpc_password = 'vincent'
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:18332"%(rpc_user, rpc_password))
def createNewAddress():
address = rpc_connection.getnewaddress();
@vincenzopalazzo
vincenzopalazzo / CHANGELOG.md
Last active March 21, 2020 23:23
JMARS_WITH_MATERIAL-UI_SWING_TABLE_CHANGELOG.md

Change log inside JMARS Beta 5.0.15 with material-ui-swing 1.1.1 official

JTable

This change require this other change

Inside the class ThemeTable you must change the configuration from this code

 UIManager.put("Table.alternateRowColor", this.isAlternaterowcolor());
@vincenzopalazzo
vincenzopalazzo / CHANGELOG-material-ui-swing-pre-release6.0.md
Last active February 24, 2020 12:42
Material-UI-Swing pre-release 6.0 description with material table style restored to version 1.1.1_beta.

Material-UI-Swing pre-release 6.0

Introduction

This version includes the complete refactoring to JButton and restored all change inside the JTable (the code of the table UI is equal to code the version 1.1.1_beta material-ui-swing version).

MaterialButtonUI Refactoring

@vincenzopalazzo
vincenzopalazzo / CHANGELOG-material-ui-swing-pre-release6.1.md
Last active March 8, 2020 20:12
Material-UI-Swing pre-release 6.1 description with material table style refactored.

Material-UI-Swing pre-release 6.1

Introduction

This version includes the complete refactoring to JButton and restored all change inside the JTable (the code of the table UI is equal to code the version 1.1.1_beta material-ui-swing version).

@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;
}
@vincenzopalazzo
vincenzopalazzo / clean-docker.sh
Created April 4, 2020 16:11
UNIX script to clean docker after traning or test IMPORTANT this script clean all container and images
#!/bin/bash
#linux Script to clean docker containers and images
$RUN_WITH_SUDO=1 #Insert 0if you have docker with user permission
if [! RUN_WITH_SUDO]
then
for NAME in $(sudo docker ps -a)
do