Skip to content

Instantly share code, notes, and snippets.

View spacemacs-cheatsheet.md

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@davoclavo
davoclavo / up-and-running-with-edeliver-on-do.md
Last active Jun 6, 2022 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver
View up-and-running-with-edeliver-on-do.md

Build Server

  • Go to Digital Ocean
  • Create new ubuntu droplet

Setup Server

@davoclavo
davoclavo / software-engineer.md
Last active May 30, 2022
Software Engineer role at Deal Engine
View software-engineer.md

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 / vine.py
Created Jul 26, 2013
Vine API from Vino with added methods
View vine.py
# coding: utf-8
import json
import logging
import requests
BASE_URL = "https://api.vineapp.com/"
class VineError(Exception):
@davoclavo
davoclavo / metaplex.md
Created Oct 11, 2021
Deploy Metaplex suite to local cluster
View metaplex.md

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

@davoclavo
davoclavo / inverted_internet.py
Last active Nov 22, 2021
Inverted internet for mitmproxy
View inverted_internet.py
#!/usr/bin/env python
"""
Inject inverting css
Usage:
inverted_internet
"""
from libmproxy import controller, proxy
import os
import sys
@davoclavo
davoclavo / account_codec_program.md
Created Oct 1, 2021
Proposal: Account Codec Program
View account_codec_program.md

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 {
View associated_token_test.diff
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 / dataURItoBlob.js
Last active Jun 2, 2021
Convert dataURI to Blob so large images do not crash the browser. Based on: http://stackoverflow.com/questions/10412299 and http://stackoverflow.com/questions/6850276
View dataURItoBlob.js
/*
The MIT License (MIT)
Copyright (c) 2016 David Gomez-Urquiza
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
View core.clj
(ns courjera.core
(:require [clj-http.client :as client]
[clojure.data.json :as json]
[clojure.string :as string]
[clj-time.core :as t]
[clj-time.format :as f]
[courjera.models :as m]
[clojure.java.io :as io]))
(System/setProperty "https.proxyHost" "localhost")