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 / stdsql.sql
Last active Oct 25, 2019
XRPL BigQuery TX per ledger per time frame
View stdsql.sql
SELECT
T.LedgerIndex,
COUNT(1) as TxCount,
MIN(L.CloseTime) as LedgerClosed
FROM xrpledgerdata.fullhistory.transactions as T
JOIN xrpledgerdata.fullhistory.ledgers as L ON (
L.LedgerIndex = T.LedgerIndex
)
WHERE
L.CloseTime > '2019-10-01 12:00:00'
View keybase.md

Keybase proof

I hereby claim:

  • I am wietsewind on github.
  • I am wietsewind (https://keybase.io/wietsewind) on keybase.
  • I have a public key ASAxGrMuZ--NGUAhUgpcPEpSdPYMi4zDzu4uy7ru8kuRVAo

To claim this, I am signing this object:

@WietseWind
WietseWind / index.js
Created Jul 22, 2019
Encode/Decode X-address in the browser (plain HTML+JS)
View index.js
<script src="https://xrpaddress.info/js/xrpl-tagged-address-codec-browser.js"></script>
<script>
var XCodec = require('xrpl-tagged-address-codec')
console.log(XCodec.Encode({ account: 'rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY', tag: 495 }))
console.log(XCodec.Decode('XV5sbjUmgPpvXv4ixFWZ5ptAYZ6PD28Sq49uo34VyjnmK5H'))
</script>
@WietseWind
WietseWind / index.js
Last active Jun 28, 2019
Simple ILP Payment Pointer
View index.js
#!/usr/bin/env node
const makePlugin = require('ilp-plugin')
const { Server } = require('ilp-protocol-stream')
const Koa = require('koa')
const app = new Koa()
const crypto = require('crypto')
process.on('SIGINT', () => {
console.log('Hi')
@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",
You can’t perform that action at this time.