- naumovs.color-highlight
- bierner.color-info
- pranaygp.vscode-css-peek
- dbaeumer.vscode-eslint
- ms-playwright.playwright
- Orta.vscode-twoslash-queries
This file contains hidden or 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
| def Attention(X, W_q, W_k, W_v): | |
| Q = X @ W_q | |
| K = X @ W_k | |
| V = X @ W_v | |
| # Q, K, V: [b, n, d] | |
| s = 1 / sqrt(d) | |
| A = Q @ K.transpose(−1,−2) ∗ s | |
| return softmax(A) @ V |
This file contains hidden or 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
| #!/bin/bash | |
| # create a prefix based on the parent git repo directory name | |
| prefix=$(basename "$(git rev-parse --show-toplevel)") | |
| # Create a directory to store the flattened files | |
| outdir="/tmp/flattened" | |
| mkdir -p "$outdir" | |
| # Find c++ files, rename them, and copy to flattened directory |
A more generic table that can be used to capture all events, onchain and offchain, for the user. For example, there may be a user referral tracked inside the database that should show up in the activity table. The table should be generic enough to be used for any event that is emitted by the send account contract or to represent any other event that a user may want to track and see in their activity feed.
The view will be adapted so that it can be added to the activity table.
create table activity (
id serial primary key,
event_name text not null, -- the name of the event usually the integration or source table name
This file contains hidden or 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 axios from 'axios'; | |
| import { poll } from 'ethers/lib/utils'; | |
| import moment from 'moment'; | |
| import Logger from '@loaders/logger'; | |
| import sleep from '@helpers/utils/sleep'; | |
| import { getRandomArbitrary } from '@helpers/utils/get-random-arbitrary'; | |
| const pricesPerDayUsd: { [day: string]: number } = {}; | |
| let historicalPricesLoaded = false; |
This file contains hidden or 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
| SELECT | |
| grantee, | |
| specific_schema, | |
| routine_name, | |
| privilege_type | |
| FROM | |
| information_schema.routine_privileges | |
| WHERE | |
| specific_schema NOT IN ('pg_catalog', 'information_schema'); |
This file contains hidden or 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
| // sponsor the creation by setting the deposit on the Entry Point | |
| const { request: depositRequest } = await baseMainnetClient.simulateContract({ | |
| address: entrypoint.address, | |
| functionName: 'depositTo', | |
| abi: iEntryPointABI, | |
| args: [senderAddress], | |
| account: dummyAccount, | |
| value: parseEther('0.5'), | |
| }) | |
| const depositHash = await walletClient.writeContract(depositRequest) |
This file contains hidden or 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
| export async function verifySignature({ | |
| authenticatorData, | |
| clientDataJSON, | |
| r, | |
| s, | |
| x, | |
| y, | |
| }: { | |
| authenticatorData: string | |
| clientDataJSON: string |
This file contains hidden or 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 zx | |
| // -*- mode: js -*- | |
| const orgName = process.argv[3]; | |
| if (!orgName) { | |
| console.log(`Usage: gh-org-contribs ${chalk.bold("<org-name>")}`); | |
| process.exit(1); | |
| } |
This file contains hidden or 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
| printf 'FROM scratch\nCOPY . /' | DOCKER_BUILDKIT=1 docker build -f - -o /tmp/docker-context . |