Skip to content

Instantly share code, notes, and snippets.

@mason276752
mason276752 / aLoop.js
Last active March 12, 2020 11:02
youtube ab loop
javascript:aloop=document.getElementsByClassName('video-stream html5-main-video')[0].currentTime;if(aloop!=null &&bloop!=null){if(aloop!="undefined" && bloop!="undefined" && aloop!=bloop ){document.getElementsByClassName('video-stream html5-main-video')[0].addEventListener("timeupdate",function(){if(aloop>bloop&&document.getElementsByClassName('video-stream html5-main-video')[0].currentTime>aloop){document.getElementsByClassName('video-stream html5-main-video')[0].currentTime=bloop;}else if(bloop>aloop&&document.getElementsByClassName('video-stream html5-main-video')[0].currentTime>bloop){document.getElementsByClassName('video-stream html5-main-video')[0].currentTime=aloop;}},false);}}
@mason276752
mason276752 / magicLine.sh
Created March 24, 2020 05:23
magic line
# set all git git config core.filemode false
find ./ -name .git -exec sh -c "cd `echo $HOME`/'{}'/../;git config core.filemode false" \;
let Web3 = require('web3');
let web3 = new Web3()
web3.setProvider("https://mainnet.infura.io/v3/xxx")
let txids=[
// "0x...",
]
txids.forEach(
txid=>{
// let mobiles=["xxxx":{"to":"oooo","count":0,"finded":false},...]
let ms=Object.keys(mobiles)
ms.forEach(function active(mobile){
if(!mobiles[mobile].finded && mobiles[mobile].count<3 && mobiles[mobile].to!==""){
mobiles[mobile].count=mobiles[mobile].count+1
if(!mobiles[mobiles[mobile].to]){
mobiles[mobile].finded=true
return console.log('can not found ',mobiles[mobile].to)
}else{
active(mobiles[mobile].to)
const ethers = require('ethers')
const randomWallet = new ethers.Wallet.createRandom()
let address = ""
const chainId= 0
const count = 1000
const wsUrl = "ws://xxx.xxx.xxx.xxx:xxxx"
const txs = [];
(async () => {
@mason276752
mason276752 / build.sh
Created February 14, 2025 07:10
elastic-funnel-hashtable
emcc elastic_hashtable.cpp -o elastic_hashtable_wasm.js \
-O3 -s MODULARIZE=1 -s EXPORT_NAME="elastic_hashtable_wasm" \
-s INITIAL_MEMORY=128MB -s ALLOW_MEMORY_GROWTH=1 \
-s EXPORTED_RUNTIME_METHODS="['cwrap']" -s SINGLE_FILE=1 \
-lembind --no-entry
emcc funnel_hashtable.cpp -o funnel_hashtable_wasm.js \
-O3 -s MODULARIZE=1 -s EXPORT_NAME="funnel_hashtable_wasm" \
-s INITIAL_MEMORY=128MB -s ALLOW_MEMORY_GROWTH=1 \
-s EXPORTED_RUNTIME_METHODS="['cwrap']" -s SINGLE_FILE=1 \