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 { decodeAddress } from "https://esm.sh/@polkadot/util-crypto"; | |
import { u8aToHex } from "https://esm.sh/@polkadot/util"; | |
const input = Deno.args[0]; | |
if (!input) { | |
console.error("usage: deno run substrateToEvm.ts <SUBSTRATE_ADDRESS_HERE>"); | |
Deno.exit(1); | |
} | |
const accountId = decodeAddress(input); | |
const res = accountId.subarray(0, 20); |
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 "npm:@webb-tools/tangle-substrate-types@^0.5.1"; | |
import { ApiPromise, WsProvider } from "npm:@polkadot/api@10.9.1"; | |
import { Keyring } from "npm:@polkadot/keyring@12.6.2"; | |
import { | |
hexToU8a, | |
stringToU8a, | |
u8aToHex, | |
u8aToString, | |
} from "npm:@polkadot/util@12.6.2"; | |
import { decodeAddress, keccakAsU8a } from "npm:@polkadot/util-crypto@12.6.2"; |
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 "npm:@webb-tools/tangle-substrate-types@^0.5.1"; | |
import { ApiPromise, WsProvider } from "npm:@polkadot/api@10.9.1"; | |
import { | |
hexToU8a, | |
stringToU8a, | |
u8aToHex, | |
u8aToString, | |
} from "npm:@polkadot/util@12.6.2"; | |
import { decodeAddress } from "npm:@polkadot/util-crypto@12.6.2"; | |
import * as ethers from "npm:ethers@6.9.1"; |
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
#[test] | |
fn extended_witness_circom2() -> Result<()> { | |
use std::collections::HashMap; | |
use ark_circom::WitnessCalculator; | |
let mut wtns = WitnessCalculator::new("./test-vectors/circom2_multiplier2.wasm").unwrap(); | |
let inputs = HashMap::from([ | |
(String::from("a"), vec![4.into()]), | |
(String::from("b"), vec![5.into()]), |
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 { | |
blake2AsU8a, | |
encodeAddress, | |
} from "https://esm.sh/@polkadot/util-crypto"; | |
import { | |
hexToU8a, | |
stringToU8a, | |
u8aConcat, | |
} from "https://esm.sh/@polkadot/util"; |
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
-- Contains Neovim/Vim API and Settings. | |
vim.g.mapleader = " " | |
vim.g.maplocalleader = " " | |
local opt = vim.opt | |
opt.hlsearch = false | |
opt.autowrite = true -- Enable auto write | |
opt.clipboard = "unnamedplus" -- Sync with system clipboard |
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
#!/usr/bin/env -S deno run -A | |
/** | |
* This script is used to generate the KPIs for a repository, by fetching all | |
* the issues/bugs that got resolved and the PRs that got merged in the specified time period. | |
* It then outputs the KPIs in a Markdown format. | |
*/ | |
// Import the required modules, we need the following: | |
// * cli - for parsing the command line arguments | |
// * github - for fetching the issues/PRs from GitHub |
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 'package:flutter/material.dart'; | |
import 'package:mobile_scanner/mobile_scanner.dart'; // version ^3.0.0-beta.4 | |
void main() => runApp(const MaterialApp(home: MyHome())); | |
class MyHome extends StatelessWidget { | |
const MyHome({super.key}); | |
@override | |
Widget build(BuildContext context) { |
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
on alfred_script(q) | |
tell application "wezterm" to activate | |
do shell script "/Applications/WezTerm.app/Contents/MacOS/wezterm cli send-text " | |
tell application "System Events" to keystroke q | |
tell application "System Events" | |
key code 36 -- enter key | |
end tell | |
end alfred_script |
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
// SPDX-License-Identifier: MIT | |
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) | |
pragma solidity ^0.8.0; | |
/** | |
* @dev String operations. | |
*/ | |
library Strings { | |
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; |
NewerOlder