Skip to content

Instantly share code, notes, and snippets.

@akuzubasli
akuzubasli / meta10K.tsv
Created January 20, 2022 13:42
meta10K
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
grafikdesign
intro
ann
angelic
365
vegan
vscode
telekinesis
chart
mecanica
@ademidun
ademidun / solana-bear-case.md
Created January 6, 2022 16:52
Some thoughts on why I think Solana is overvalued
@Danlowe95
Danlowe95 / gist:8ae5767a95e8321c255e2b1345f351fb
Last active April 6, 2022 16:07
Bug in program.account.<account>.fetch() when account contains a field that is an array of Option<CustomStruct>, and CustomStruct contains Optionals.

Update

Gist #2 below provides a more concise explanation of what I believe is going wrong and causing decoding to fail. I am leaving gist #1 up, but would recommend readers to read Gist #2 first to get a better understanding of the problem.

Problem

Breaking code:

    let primaryStruct = await program.account.primaryStruct.fetch(stateAccount);

The error:

@Xavier59
Xavier59 / privatekeysolana.js
Created December 28, 2021 14:49
Convert Solana private key from/to base58/uint8array
// exporting from a bs58 private key to an Uint8Array
// == from phantom private key to solana cli id.json key file
// npm install bs58 @solana/web3.js
const web3 = require("@solana/web3.js");
const bs58 = require('bs58');
let secretKey = bs58.decode("[base58 private key here]");
console.log(`[${web3.Keypair.fromSecretKey(secretKey).secretKey}]`);
// exporting back from Uint8Array to bs58 private key

Wanderer Staking Validator Security Statement

Wanderer Staking is an independent professional working in IT area and providing the robust and reliable staking services in various networks, including Solana, Oasis, Cosmos-based networks and Polkadot-networks.

The main concept is to

  • utilize only dedicated servers infrastructure
  • utilize the high level security measures, to protect the private keys and infrastructure from the ext intrusion
  • setup the failover solutions (non-validating nodes, hot-swap nodes and snapshots)
  • setup and maintenance of the alerts system (Prometheus, Grafana, Telegram)
@dtmrc
dtmrc / fix.sh
Created December 23, 2021 20:47 — forked from MatthewPierson/fix.sh
Fix for irecovery errors with PyBoot
#!/bin/bash
echo "Downloading and building libimobiledevice" # Just want to make sure theres no libimobiledevice related issues when installing libirecovery
brew install --HEAD libimobiledevice # This is just getting the latest libimobiledevice and building it instead of the older version that brew usually gets
brew link --overwrite libimobiledevice
echo "Downloading and building libirecovery"
mkdir -p build && cd build

CLI

Run local network on M1

solana config set --url localhost
solana-test-validator --no-bpf-jit

Create App

const magicEdenURL = "https://api-mainnet.magiceden.io/rpc/getListedNFTsByQuery?q=%7B%22%24match%22%3A%7B%22collectionSymbol%22%3A%22essence_by_enigma_expanses%22%7D%2C%22%24sort%22%3A%7B%22takerAmount%22%3A1%2C%22createdAt%22%3A-1%7D%2C%22%24skip%22%3A0%2C%22%24limit%22%3A10%7D";
const exchangeURL = "https://api.exchange.art/v1/public/tokens?limit=10&sort=price-asc&from=0&filters=%7B%22tokenListingTypes%22:%5B%22listed%22,%22unlisted%22%5D,%22collections%22:%5B%22Essence%22%5D%7D&view=collection";
var XMLHttpRequest = require('xhr2');
function floorPiecesMagicEden() {
var http = new XMLHttpRequest();
http.open("GET", magicEdenURL);
http.send();
http.onreadystatechange = (e) => {
Readers who are interested in the actionable aspects of this topic should probably read the last instalment in this series: https://commoncog.com/blog/accelerated-expertise/
The basic idea is this:
1. Deliberate practice only works for skills with a history of good pedagogical development. If no such pedagogical development exists, you can’t do DP. Source: read Peak, or any of Ericsson’s original papers. Don’t read third party or popsci accounts of DP.
2. Once you realise this, then the next question you should ask is how can you learn effectively in a skill domain where no good pedagogical development exists? Well, it turns out a) the US military wanted answers to exactly this question, and b) a good subsection of the expertise research community wondered exactly the same thing.
3. The trick is this: use cognitive task analysis to extract tacit knowledge from the heads of existing experts. These experts built their expertise through trial and error and luck, not DP. But you can extract their knowledge a
@zicklag
zicklag / base58-to-array.ts
Created December 6, 2021 19:07
Base58 decode to array for Solana key from Phantom
import bs58 from "https://cdn.skypack.dev/bs58";
const bytes = bs58.decode(Deno.args[0]);
console.log(JSON.stringify(Array.from(bytes)));