Skip to content

Instantly share code, notes, and snippets.

View davoclavo's full-sized avatar
🎯
Focusing

Davo davoclavo

🎯
Focusing
View GitHub Profile
@davoclavo
davoclavo / metaplex.md
Created October 11, 2021 16:13
Deploy Metaplex suite to local cluster

Deploy Metaplex

git clone git@github.com:metaplex-foundation/metaplex.git

cd metaplex/rust

cargo build-bpf

solana config set --url localhost

solana-test-validator

diff --git a/tests/misc/programs/misc/src/context.rs b/tests/misc/programs/misc/src/context.rs
index a095fdf..284833e 100644
--- a/tests/misc/programs/misc/src/context.rs
+++ b/tests/misc/programs/misc/src/context.rs
@@ -49,6 +49,17 @@ pub struct TestInitAssociatedToken<'info> {
pub associated_token_program: Program<'info, AssociatedToken>,
}
+#[derive(Accounts)]
+pub struct TestValidateAssociatedToken<'info> {
@davoclavo
davoclavo / account_codec_program.md
Created October 1, 2021 23:42
Proposal: Account Codec Program

Given that it is kind of tricky to know how to read data from accounts, it would be really useful to have an "Account Codec Program" as a central repository of Program Accounts type schemas.

I'm thinking with this program you could register Program Account schemas to know what format to use to Decode them. As an analogy, its like storing the Anchor's IDL on chain, or also akin to how the Metaplex Metadata Token program is the standard where you define metadata for an NFT Mint

E.g.

Some program's account:

declare_id!("SomeProgramPubkey987654321")
struct Person {
@davoclavo
davoclavo / software-engineer.md
Last active May 30, 2022 17:06
Software Engineer role at Deal Engine

Software Engineer role at Deal Engine

At Deal Engine we strive on automating and optimizing processes in an industry that has been stagnant for several decades - the travel industry.

  • Have you ever wondered what happens to your ticket when you miss a flight? And did you know you can always get some money back?
  • Have you ever been able to change a flight without having to spend hours calling customer support?
  • Have you ever experienced the price volatility where sometimes you end up paying a lot more than the person sitting next to you on a plane?

We solve these and more pains! We work alongside airlines (e.g. LATAM airlines) and online travel agencies (e.g. Despegar) and operate in 18 countries (across 3 continents), managing over $4 billion dollars in flight tickets. We are on a mission to become the most efficient and transparent backbone of the travel industry.

@davoclavo
davoclavo / keybase.md
Created August 6, 2019 18:54
keybase.md

Keybase proof

I hereby claim:

  • I am davoclavo on github.
  • I am davoclavo (https://keybase.io/davoclavo) on keybase.
  • I have a public key ASD4Am3OKkqntnvK5LFB7w15YA0fElSjPf8g1EWO77bK9Ao

To claim this, I am signing this object:

@davoclavo
davoclavo / key.md
Created February 28, 2019 06:56
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@davoclavo
davoclavo / spacemacs-cheshe.md
Created January 8, 2019 19:22 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@davoclavo
davoclavo / download_vines.py
Last active December 9, 2016 21:33
Python script to download your Vine timeline and likes
import os
import vinepy
import time
import requests
vine = vinepy.API(username='your@email.com', password='your_password')
main_dir = os.path.expanduser("~/Desktop/vines/")
def save_vines(vines, subfolder):
sub_dir = os.path.join(main_dir, subfolder)

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

import Html exposing (Html, input, text, div)
import Html.App exposing (beginnerProgram)
import Html.Attributes exposing (type')
import Html.Events exposing (on, targetValue, onInput)
import Json.Decode as Json
type alias Model =
{ value : String
}