View index.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
const repos = [] | |
const knownRepoCall = await fetch('https://raw.githubusercontent.com/electric-capital/crypto-ecosystems/master/data/ecosystems/x/xrp.toml') | |
const knownRepoData = await knownRepoCall.text() | |
for (let page = 1; page < 10; page++) { | |
const call = await fetch('https://api.github.com/search/repositories?q=xrp+xrpl&order=desc&per_page=1000&page=' + page) | |
const json = await call.json() |
View payment.mermaid
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View banxa-api-signature.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'node-fetch' | |
import {createHmac} from 'crypto' | |
const endpoint = 'xxxxxx | |
const key = 'yyyyyy' | |
const secret = 'xxxxxxxx' | |
const banxaCall = async (path, body, method = 'GET') => { | |
const nonce = Math.round(new Date() / 1000) |
View setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Install xrpld monitoring' | |
echo '' | |
echo 'Please provide some info, if you need to change this, you can do so later in /etc/crontab' | |
echo '' | |
echo 'Local host + port with xrpld websocket, e.g. "localhost:6006"' | |
read host | |
echo '' |
View animated-gif-for-tydbit.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
import sharp from 'sharp' | |
import fetch from 'node-fetch' | |
import { Gif } from 'make-a-gif' | |
sharp.cache(false) | |
const app = express() | |
const port = 3000 |
View svg-to-gif-for-tydbit.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express' | |
import sharp from 'sharp' | |
import fetch from 'node-fetch' | |
sharp.cache(false) | |
const app = express() | |
const port = 3000 | |
const device = 'some-device-name-whatever-123' |
View index.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { XrplClient } from 'xrpl-client' | |
const config = { backfillLedgers: 20, lastLedger: null } | |
const client = new XrplClient(['wss://xrplcluster.com']) | |
await client.ready() | |
config.lastLedger = client.getState().ledger.last - config.backfillLedgers | |
function getLedgerTransactions(ledger_index) { | |
return client.send({ command: 'ledger', transactions: true, expand: true, ledger_index }) |
View user-profile-script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(accessToken, ctx, callback) { | |
const url = "https://oauth2.xumm.app/userinfo"; | |
request.get( | |
{ url, headers: { 'Authorization': 'Bearer ' + accessToken, } }, | |
(err, resp, body) => { | |
if (err) { | |
return callback(err); | |
} | |
if (resp.statusCode !== 200) { |
View pkce-implicit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>OAuth Authorization Code + PKCE in Vanilla JS</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | |
<!-- Credits: https://github.com/aaronpk/pkce-vanilla-js/blob/master/index.html --> | |
<script> | |
// Configure your application and authorization server details | |
var config = { | |
client_id: "<The Xumm App API key (public)>", |
View build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm ./module.wasm | |
rm ./module.wat | |
node assemblyscript/bin/asc \ | |
-O3 \ | |
--noAssert \ | |
--runtime minimal \ | |
--textFile ./module.wat \ |
NewerOlder