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
// Creates Instruction layout for syncing state | |
function createInstructionData(index: number) { | |
const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]); | |
const data = Buffer.alloc(dataLayout.span); | |
dataLayout.encode({ instruction: index }, data); | |
return data; | |
} | |
// Creates synchronize state instruction | |
function createSynchronizeProgramInstruction(source: PublicKey, target: PublicKey) { |
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
async function executeAirdropTransaction() { | |
const connectionManager = await createConnection("mainnet-beta"); | |
// Generate Transactions | |
// const instructions: TransactionInstruction[] = []; | |
// const transactions: Transaction[] = []; | |
const airdropTransactionEntries = Object.values(airdropTransactionsLogs); | |
const lastSuccessfulIndex = airdropTransactionEntries.findLastIndex( | |
(value) => !value.signature |
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 { DOMElements } from "@chakra-ui/vue-system" | |
import { computed, defineComponent } from "vue" | |
function cx(...args: any[]) { | |
return args.filter(Boolean).join(" ") | |
} | |
function splitProps(props: any) { | |
const styleProps = {} | |
const elementProps = {} |
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 { Transaction, Connection, clusterApiUrl } from "@solana/web3.js"; | |
const connection = new Connection(clusterApiUrl("devnet")); | |
// Get the wallet object from your wallet provider | |
const wallet = useWallet() | |
export async function signTransaction(transaction) { | |
// 1. Get transaction form back end and construct buffer form it. | |
const serializedTransaction = Buffer.from(transaction, "base64"); |
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
<div class="flex flex-col justify-center items-center"> | |
<div class="wrapper flex mb-3"> | |
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1100&q=80" alt="avatar1" class="image"> | |
</a> | |
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="avatar2" class="image"> | |
</a> | |
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1527980965255-d3b416303d12?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1100&q=80" alt="avatar3" class="image"> | |
</a> | |
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1540746354979-c2ecadbc01d6 |
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 | |
pragma solidity ^0.8.4; | |
/* | |
INSTRUCTIONS FOR THIS TEST | |
========================== | |
1. Deploy Store | |
2. Deposit 1 ETH each from Account 1 (Alice) and Account 2 (Bob) into Store | |
3. Deploy `Consumer` with address of `Store` | |
4. Call Consumer._withdraw sending 1 ETH (using Account 3 (Eve)). |
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
TypeScript 13 hrs 39 mins ████████████████▓░░░ 69.0% | |
Solidity 2 hrs 11 mins █████░░░░░░░░░░░░░░░ 11.1% | |
Vue.js 2 hrs 6 mins █████░░░░░░░░░░░░░░░ 10.7% | |
JSON 1 hr 8 mins ████░░░░░░░░░░░░░░░░ 5.8% |
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
# This script will look for all the files inside the `~/.profiles.d/` directory and require them in a new terminal | |
# Source all files in .profile.d | |
# ============================ | |
for file in ~/.profile.d/* | |
do | |
source $file | |
done |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// So I'm struggling to name this function so I called it `indexArrayBy` | |
// but it's really doing more. Here's a link to it's demo: | |
// Demo: https://playcode.io/612180/ | |
/** | |
* Transforms an array of objects into an object containing the values | |
* indexed by a unique property on each object, e.g. id and | |
* an array containing all the keys (So you get the keys). | |
* | |
* @param {Array<Object>} array Array of objects |
NewerOlder