Skip to content

Instantly share code, notes, and snippets.

@jamland
jamland / mavic-parameters.md
Created June 1, 2023 17:55
DJI Mavic Parameters

details: https://dronarium.academy/yak-uvimknuty-rezhym-atti-na-dji-mavic-3/
from https://mavicpilots.com/threads/dh-parameter-hacks.124785/

  • fswitch_selection|g_config.control.control_mode[0] (3 - enable atti mode instead of cinema mode, back- 12)

  • fswitch_selection_1|g_config.control.control_mode[1] (3 -enable pseudo-atti mode instead of sport mode, back - 8)

  • g_config.fdi_open.close_auto_stop_motor_check (disable turning off the motors when the drone is tilted more than 85° from the horizontal position)

  • forearm_led_ctrl|g_config.misc_cfg.forearm_lamp_ctrl (0 -turn off all lights on the drone )

@jamland
jamland / iterate_struct_list.rs
Last active August 23, 2022 18:56
Struct list manipulations in Rust
// this is Rust example of common manipulations over list in functional way
// similar to how it is usually done with JavaScript
// PartialEq, Eq, PartialOrd, Ord are needed to do sort later
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
enum Gender {
Male,
Female,
Other,
}
@jamland
jamland / solana-vanity-grind.md
Created January 12, 2022 15:39
Generate Custom Solana Vanity Grind Address

Generate Solana wallet starts-with text:1 stop after first match

solana-keygen grind --ignore-case --starts-with andy:1

CLI

Run local network on M1

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

Create App

const util = require("util");
const path = require("path");
const exec = util.promisify(require("child_process").exec);
const fs = require("fs");
const splToken = "G7eETAaUzmsBPKhokZyfbaT4tD9igdZSmfQGEYWem8Sw";
const iterateOverRecievers = async () => {
const rawdata = fs.readFileSync(
path.resolve(__dirname, "./address-for-drop.json")
@jamland
jamland / Trick Candy Machine Upload command from Jordan.md
Last active April 17, 2022 22:34
Trick from j about using devnet uploaded stuff on mainnet (got from office hours)

Using this trick you can test your collection on devnet, verfiy everything on devnet, and don't run arweave uploads twice

  1. Upload all files to devnet, verify files and metadata
  2. Rename devnet-cache to mainnet-beta-temp
  3. Remove program & candyMachineAddress field,
  4. Rename env -> "env": "mainnet-beta"
  5. Set all "onChain": true -> "onChain": false
  6. Run upload command. It will verify and register uploaded data to mainnet-beta
@jamland
jamland / import-phantom-wallet.md
Created September 28, 2021 10:40
Import Solana wallet from Phantom to CLI

so if you want to import one of the keys from phatom, you can run:

solana-keygen recover 'prompt:?key=0/0' --outfile ~/.config/solana/<KEYFILE>
@jamland
jamland / metaplex-candy-machine-help.md
Last active November 26, 2021 17:50
Metaplex Candy Machine help

@metaplex/cli aka Candy Machine Help

Format

  • Folder with files named from 0-1.png
  • JSON file with attributes, format
    • Array with indices matching images
    • Contains: title, description and array of traits ({"display_type":"number","trait_type":"generation","value":2})
@jamland
jamland / update item on candy machine.md
Created September 16, 2021 17:16
Update single item on Metaplex Candy Machine

Q: Say you upload a whole 10k set ahead of time then realize that you messed one up and want to fix the arweave data. Are you hosed, and just have to re-upload everything with a new CM?

A: Go to the temp file created by CM. Find the one is broken. Change arweave URL to new one which is not broken. Mark on-chain: true -> false. Re-run the upload command. Upload command will find the one is missing and reupload it.