Skip to content

Instantly share code, notes, and snippets.

View alysiawu's full-sized avatar
🎯
Focusing

Alysia Wu alysiawu

🎯
Focusing
View GitHub Profile
import hre from 'hardhat';
console.log('after hre');
import { DeploymentManager } from '../plugins/deployment_manager/DeploymentManager';
import { exp, fastForward } from '../test/helpers';
import { impersonateAddress } from '../plugins/scenario/utils';
import { setNextBaseFeeToZero } from '../scenario/utils/hreUtils';
import { getConfigurationStruct } from '../src/deploy';
console.log('after hre');
console.log('before hre');
import hre from 'hardhat';
console.log('after hre');
import { DeploymentManager } from '../plugins/deployment_manager/DeploymentManager';
import { sourceTokens } from '../plugins/scenario/utils/TokenSourcer';
import { exp, fastForward } from '../test/helpers';
import { impersonateAddress } from '../plugins/scenario/utils';
const { Contract, utils } = require('ethers');
const ethers = require('ethers');
const compABI = require('./comp-abi.json');
async function timeJump() {
async function getBlock(n, provider) {
const blockNumber = n == undefined ? await provider.getBlockNumber() : n;
return provider.getBlock(blockNumber);
}
const ethers = require('ethers');
const governorABI = require('./governor-abi.json');
async function castVote() {
// First, we need to connect to the Ethereum network
// https://ethforks.io/fork/aed9fe4c-6918-4dc5-88ba-9b1062aaf701'
const provider = new ethers.providers.JsonRpcProvider('http://127.0.0.1:8545', {
chainId: 1,
});
@alysiawu
alysiawu / gist:8247aacfe650469c40f80425057e6aff
Created November 29, 2021 21:04
useSellDirect + useLasteLead
query GetHubSellPage(
$sellerInputUUID: String
$customerUUID: String
$addressUUID: String
) {
seller {
getLatestLead(
input: { addressUuid: $addressUUID, customerUuid: $customerUUID }
) {
lead {
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
@alysiawu
alysiawu / add-binary.js
Last active April 10, 2020 04:23
67. Add Binary Easy 1505 255 Add to List Share Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: Each string consists only of '0' or '1'…
/**
* @param {string} a
* @param {string} b
* @return {string}
*/
var addBinary = function(a, b) {
let i = a.length - 1, j = b.length - 1
let res = ''
let carry = 0
while (i >= 0 || j >= 0) {
<svg width="639" height="205" xmlns="http://www.w3.org/2000/svg">
<style>
.lefty {
animation: 1.25s ease-out 0s infinite fall-fade-left;
}
.righty {
animation: 1.25s ease-out .10s infinite fall-fade-right;
}
@alysiawu
alysiawu / index.html
Created March 22, 2020 07:55
LYVJbLZ
<div id="root"></div>
@alysiawu
alysiawu / index.html
Created March 22, 2020 07:54
Progress Bar (javascript)
<h1>Progress bar</h1>
<h2>Javascript using SetInterval to increment the element's width</h2>
<div class="meter cadetblue">
<span data-progress="100" style="width:0;"></span>
</div>
<div class="meter">
<span data-progress="35" style="width:0;"></span>
</div>