Skip to content

Instantly share code, notes, and snippets.

Wietse Wind WietseWind

Block or report user

Report or block WietseWind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WietseWind
WietseWind / cc.js
Last active Jun 16, 2019
Escrow Crypto Conditions based on UTF-8 buffer
View cc.js
cc = require('five-bells-condition')
const fulfillment_bytes = Buffer.from('Hi! This is me testing :) 😇 🎉🎈🍺🎂🍾🍻...'.repeat(1), 'utf8') //.toString('hex').toUpperCase()
// Or random:
// const fulfillment_bytes = crypto.randomBytes(2)
console.log('EscrowFinish Fee:', 10 * (33 + Math.ceil(Buffer.byteLength(fulfillment_bytes) / 16)))
console.log()
// console.log(fulfillment_bytes)
const myFulfillment = new cc.PreimageSha256()
@WietseWind
WietseWind / afas-tableau-wdc.html
Created May 15, 2019
AFAS RestConnector Tableau Web Data Connector
View afas-tableau-wdc.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://connectors.tableau.com/libs/tableauwdc-2.3.latest.js" type="text/javascript"></script>
<script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js?flags=gated%7Calways"></script>
<script src="https://cdn.jsdelivr.net/npm/fetch-polyfill@0.8.2/fetch.min.js"></script>
@WietseWind
WietseWind / pub.js
Last active Apr 9, 2019
Redis + Node PubSub vs. Task Publisher / Task Runner
View pub.js
// PubSub example, check pub.js and sub.js
// This is the publising of messages
// Messages will only be seen by subscribers that are already listening
// Credits: https://thisdavej.com/guides/redis-node/node/pubsub.html
const Redis = require('ioredis')
const pub = new Redis()
const channel = 'mychannel:123'
console.log('Started publisher...')
@WietseWind
WietseWind / query.sql
Created Mar 27, 2019
XRPL BigQuery: Find activation date for Account
View query.sql
SELECT
CloseTimeHuman
FROM
xrpledgerdata.fullhistory.ledgers
WHERE
LedgerIndex = (
SELECT
LedgerIndex
FROM
xrpledgerdata.fullhistory.transactions
@WietseWind
WietseWind / memo.js
Created Mar 18, 2019
XRPL Payment with Memo
View memo.js
const RippledWsClient = require('rippled-ws-client')
const RippledWsClientSign = require('rippled-ws-client-sign')
const SeedOrKeypair = 'sZZZZZZZZZ' // The secret of the sending wallet
const Transaction = {
TransactionType: 'Payment',
Account: 'rXXXXX',
Destination: 'rYYYYYYY',
Amount: 4635000000,
@WietseWind
WietseWind / label-color.js
Created Mar 8, 2019
Generate Meetup labels
View label-color.js
const username = process.argv[2]
const type = process.argv[3] || 1
const sharp = require('sharp')
const QRCode = require('qrcode')
const fetch = require('node-fetch')
const printer = require("node-printer-lp-complete")
const printOptions = {
media: 'Custom.25x50mm',
destination: "ColorLabelPrinter",
View index.js
const elliptic = require('elliptic')
const secp256k1 = elliptic.ec('secp256k1')
const hash = require('hash.js')
const keypairs = require('ripple-keypairs')
const hexToDecimal = (x) => secp256k1.keyFromPrivate(x, 'hex').getPrivate().toString(10)
module.exports = {
sign (message, familySeed) {
const digest = hash.sha256().update(message).digest('hex').toUpperCase()
@WietseWind
WietseWind / child.js
Created Feb 15, 2019
NodeJS parent/child communication (fork) -- Ugly & basic
View child.js
let parentId
process.on('message', (msg) => {
if (typeof msg.parentId !== 'undefined') parentId = msg.parentId
console.log(`[CHILD_${parentId}] » Message from parent`, msg)
})
let counter = 0
let interval = setInterval(() => {
@WietseWind
WietseWind / iou-payments.md
Last active May 13, 2019
XRPL IOU Payments
View iou-payments.md

DEX

Send EUR to XRP (the other way around) to another account with sell offer)

DEX

{
	"TransactionType": "TrustSet",
	"Account": "rpePPeRpC89vpCY3CDzhzMCs78nPoNnAKm",
	"Fee": "12",
View coil.js
<script src="https://polyfill.webmonetization.org/polyfill.js"></script>
<script src="https://cdn.coil.com/donate.js"></script>
<script>
window.WebMonetizationScripts.donate({
paymentPointer: '$twitter.xrptipbot.com/WietseWind'
})
</script>
You can’t perform that action at this time.