Skip to content

Instantly share code, notes, and snippets.

View jeasonstudio's full-sized avatar
:octocat:
Focusing

Jeason jeasonstudio

:octocat:
Focusing
View GitHub Profile
@jeasonstudio
jeasonstudio / index.html
Created June 24, 2024 09:54
Convert MetaMask snap(arsnap) into JWK file, and you can import to ArConnect Wallet
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arweave Keyfile Converter</title>
</head>
<body>
<main>
<input
@jeasonstudio
jeasonstudio / artela-zan.js
Last active June 3, 2024 07:02
Automatic interactive with ZAN and Artela testnet.
// Usage: `PRIVATE_KEY=0xfffff...fff node artela-zan.js`
import { privateKeyToAccount } from 'viem/accounts';
import { generateSiweNonce, createSiweMessage } from 'viem/siwe';
import {
defineChain,
createWalletClient,
createPublicClient,
http,
} from 'viem';
@jeasonstudio
jeasonstudio / calcHashRate.js
Created April 7, 2024 10:03
Calculate #EggFarm total hash rate
/**
* 预估 #EggFarm 的总算力
* @param {number} difficulty 当前难度
* @param {number} intervals 间隔时间,预期是 60s,但目前比较短,需要按实际情况估算,单位秒
*/
const calcHashRate = (difficulty, intervals = 60) => {
const baseDifficulty = 0x10c6f7a0b5ed8d0000000000000000000000000000000000000000000000;
const target = baseDifficulty / difficulty;
const hashRate =
1 /
@jeasonstudio
jeasonstudio / deploy.js
Created October 27, 2023 07:17
Deploy on scroll mainnet
// 切换到 Scroll Mainnet (0x82750)
// 或者是 Scroll Sepolia Testnet(0x8274f)
await ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: '0x82750' }],
});
// 连接钱包(选择有余额的账户)
const [address] = await ethereum.request({ method: 'eth_requestAccounts' });
@jeasonstudio
jeasonstudio / Playground.hs
Created January 24, 2022 09:14
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
-- and uses its hash, and the game validator script, to lock
-- some funds (the prize) in a pay-to-script transaction output.
-- Player 2 guesses the word by attempting to spend the transaction
-- output. If the guess is correct, the validator script releases the funds.
-- If it isn't, the funds stay locked.
import Control.Monad (void)
import Data.ByteString.Char8 qualified as C
import Data.Map (Map)
import Data.Map qualified as Map
javascript: (function() {
let liveInfo = window.hyPlayerConfig.stream.data[0].gameStreamInfoList;
let liveUrl = `${liveInfo[0].sHlsUrl}/${liveInfo[0].sStreamName}.m3u8`;
window.open(`iina://weblink?url=${encodeURIComponent(liveUrl)}`);
window.close();
})()
<div style="padding: 16px;border: 1px solid #e2e2e2;display: inline-block;">
<table border="0" cellspacing="0" cellpading="0" style="white-space:nowrap;width:440px!important;">
<tr>
<td style="white-space:nowrap;vertical-align:middle;width:113px">
<img src="https://s.gravatar.com/avatar/7104d85abc995236f700ea85b695137f?s=100" style="white-space:nowrap;border-right:1px solid #f1f1f1;padding-right: 12px;height: 100px;">
</td>
<td style="white-space:nowrap;font-family:Helvetica, Arial;padding-left: 10px;font-size: 14px;vertical-align:middle;white-space:nowrap">
<h1 style="white-space:nowrap;font-size:18px; color:#191f25;line-height: 1;margin: 0 0 8px 0">赵吉彤(牧曈)</h1>
<h4 style="white-space:nowrap;font-size:14px; color:#191f25;line-height: 1;margin: 0 0 8px 0;font-weight: 600;">阿里云事业群 - 中台体验部 |
<span style="white-space:nowrap;text-decoration: none; color: #191f25">前端工程师</span>
#define HAVE_REMOTE
#define WPCAP
#include <pcap.h>
#pragma comment(lib, "wpcap.lib")
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "ws2_32.lib")
#define ETH_ARP 0x0806 //以太网帧类型表示后面数据的类型,对于ARP请求或应答来说,该字段的值为x0806
#define ARP_HARDWARE 1 //硬件类型字段值为表示以太网地址
#define ETH_IP 0x0800 //协议类型字段表示要映射的协议地址类型值为x0800表示IP地址
<div style="padding: 16px;border: 1px solid #e2e2e2;display: inline-block;">
<table border="0" cellspacing="0" cellpading="0" style="white-space:nowrap;width:440px!important;">
<tr>
<td style="white-space:nowrap;vertical-align:middle;width:113px">
<img src="https://s.gravatar.com/avatar/7104d85abc995236f700ea85b695137f?s=500" style="white-space:nowrap;border-right:1px solid #f1f1f1;padding-right: 12px;height: 100px;">
</td>
<td style="white-space:nowrap;font-family:Helvetica, Arial;padding-left: 10px;font-size: 14px;vertical-align:middle;white-space:nowrap">
<h1 style="white-space:nowrap;font-size:18px; color:#191f25;line-height: 1;margin: 0 0 8px 0">赵吉彤(牧曈)</h1>
<h4 style="white-space:nowrap;font-size:14px; color:#191f25;line-height: 1;margin: 0 0 8px 0;font-weight: 600;">阿里云事业群 - 中台体验部 |
<span style="white-space:nowrap;text-decoration: none; color: #191f25">前端工程师</span>
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"