Skip to content

Instantly share code, notes, and snippets.

@sisou
sisou / NimiqTransactionSerialization_Basic.md
Created July 26, 2024 13:43
Albatross Transaction Serialization (Basic)

Albatross Transaction Serialization (Basic)

Transaction Creation

We'll be creating a basic transaction signed with and sent from the following private key (all zeroes):

0000000000000000000000000000000000000000000000000000000000000000
@sisou
sisou / Buffer.js
Created September 18, 2023 08:31
Simple JS Buffer implementation to easily read and write Uint8Arrays
export default class Buffer extends Uint8Array {
/**
* @param {number} length
*/
constructor(length) {
super(length);
this._cursor = 0;
}
/**
@sisou
sisou / .gitignore
Last active September 18, 2023 14:32 — forked from philholden/webauthn.js
A demo for signing and verifying Nimiq transaction signatures with WebAuthn
node_modules
@sisou
sisou / node-nimiq-mempool.js
Created December 25, 2021 23:24
NodeJS script to run a Nimiq (full) node to listen to all transactions getting added to the mempool.
const Nimiq = require('@nimiq/core');
Nimiq.load().then(async function() {
// Configure for Testnet. For Mainnet, use main().
Nimiq.GenesisConfig.test();
// Instantiate a config builder.
const configBuilder = Nimiq.Client.Configuration.builder();
// Require a mempool
@sisou
sisou / NimiqHDKeyDerivation.html
Created July 24, 2018 22:50
Nimiq Hierarchical Deterministic Key Derivation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Nimiq Key Derivation</title>
<script src="https://rawgit.com/emn178/js-sha512/master/build/sha512.min.js"></script>
<script src="https://cdn.nimiq.com/web-offline.js"></script>
<script>
@sisou
sisou / index.html
Created August 10, 2017 07:13
setImmediate-polyfill webworker problem demonstration
<html>
<head>
<script src="setImmediate.js"></script>
<script>
new Worker('webworker.js');
function work() {
for(i = 0; i < 20000; i++) {
Math.sqrt(1239081730591);
}
@sisou
sisou / script.lua
Created January 14, 2017 14:27
Transport Fever EU Mission 7 - Added counter of remaining months for current phase. If counter < 0, the counter becomes the failed icon.
local TaskManager = require "TaskManager"
local missionutil = require "missionutil"
local function makeIntroTask(labelParams, doneFn)
local info = {
name = _("Überblick"),
paragraphs = {
{ text = _("Wir schreiben das Jahr 1987 und Margaret Thatcher ist soeben das dritte Mal in Folge zur Premierministerin Grossbritanniens gewählt worden. Nun endlich kann ein Projekt in Angriff genommen werden, das schon seit über zweihundert Jahren geplant wird: Eine Landverbindung, die Reisende trockenen Fusses von Frankreich nach England bringt – ein Tunnel unter dem Ärmelkanal!\n\n\z
Wir wurden auserwählt, dieses Meisterwerk der Technik zu bauen. Zeigen wir unser Können!")
@sisou
sisou / CronRunCommand.php
Last active June 18, 2022 10:29
Cron job command for Laravel 4.2
<?php
# Cron job command for Laravel 4.2
# Inspired by Laravel 5's new upcoming scheduler (https://laravel-news.com/2014/11/laravel-5-scheduler)
#
# Author: Soren Schwert (GitHub: sisou)
#
# Requirements:
# =============
# PHP 5.4