Skip to content

Instantly share code, notes, and snippets.

View davoclavo's full-sized avatar
🎯
Focusing

Davo davoclavo

🎯
Focusing
View GitHub Profile

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 / dataURItoBlob.js
Last active May 26, 2023 14:45
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
/*
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
@davoclavo
davoclavo / vine.py
Created July 26, 2013 21:28
Vine API from Vino with added methods
# coding: utf-8
import json
import logging
import requests
BASE_URL = "https://api.vineapp.com/"
class VineError(Exception):
@davoclavo
davoclavo / up-and-running-with-edeliver-on-do.md
Last active June 6, 2022 11:55 — forked from mattweldon/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new ubuntu droplet

Setup Server

@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 / 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

@davoclavo
davoclavo / inverted_internet.py
Last active November 22, 2021 15:50
Inverted internet for mitmproxy
#!/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 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 {
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 / core.clj
Last active September 3, 2019 20:51
courjera
(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")