Skip to content

Instantly share code, notes, and snippets.

View xtools-at's full-sized avatar

Martin xtools-at

View GitHub Profile
@xtools-at
xtools-at / Dockerfile
Last active August 22, 2023 08:24
Mnemonic Shamir Secret Sharing Tool in Docker
# Run "Mnemonic Shamir Secret Sharing Tool" in Docker
# More info: https://github.com/ava-labs/mnemonic-shamir-secret-sharing-cli
##### How to use:
# - start docker daemon
# - `cd` to this directory, then:
### build image once
# docker build -t msss .
@xtools-at
xtools-at / ga.js
Last active August 10, 2022 14:56
Google Analytics in Next.js - Examples using "react-ga"
// Google Analytics helper for Next.js
const ReactGA = require('react-ga');
module.exports = {
initGA: () => {
ReactGA.initialize('UA-XXXXXXX-NN');
},
logPageView: () => {
const page = window.location.pathname + window.location.search;
@xtools-at
xtools-at / rpcTestMoralis.js
Created February 20, 2022 14:46
RPC test (Moralis)
const Web3 = require('web3'); // [email protected]
const startBlock = 20784230;
const rpcMaxBlocksServer = 100 * 1000;
const rpcUrl = 'https://speedy-nodes-nyc.moralis.io/[YOUR_MORALIS_TOKEN]/polygon/mumbai';
const waitBatchRpcCalls = 250; // ms
// contract adresses and abis
const contracts = [
{
@xtools-at
xtools-at / rpcTest.js
Created February 10, 2022 14:00
PolyWars RPC test
const Web3 = require('web3'); // [email protected]
const startBlock = 901990;
const rpcMaxBlocksServer = 1000;
const rpcUrl = 'https://pangolin-rpc.darwinia.network';
const waitBatchRpcCalls = 60; // ms
// contract adresses and abis
const contracts = [
{
@xtools-at
xtools-at / myetherapi_express_proxy.js
Last active July 29, 2018 13:56
MyEtherAPI Proxy in Express
const express = require('express');
const axios = require('axios');
const bodyParser = require('body-parser');
// create our app
var app = express();
const PORT = process.env.PORT || 3000;
// body parser for json requests
app.use(bodyParser.json());
@xtools-at
xtools-at / HttpsWebViewExample.java
Last active February 13, 2023 04:44
Force Android WebView to load Ressources via HTTPS
package at.xtools.httpswebviewexample;
import android.annotation.TargetApi;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@xtools-at
xtools-at / IntroductoryOverlay.java
Last active July 13, 2016 18:46
Android Introduction Overlay Class in CCL
//copied from https://github.com/googlecast/CastCompanionLibrary-android
/*
* Copyright (C) 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@xtools-at
xtools-at / cast-ftu.java
Last active July 13, 2016 11:01
Show first-time-user explaination for Google Cast (Android)
//copied from https://github.com/googlesamples/android-UniversalMusicPlayer
//modified by xTools
/**
* Shows the Cast First Time User experience to the user (an overlay that explains what is
* the Cast icon)
*/
//call this if device was detected
private void showFtu(int menuItemId) {