Skip to content

Instantly share code, notes, and snippets.

View robertDurst's full-sized avatar
🌎
wfh

Rob Durst robertDurst

🌎
wfh
View GitHub Profile
@robertDurst
robertDurst / SEP007.md
Last active May 29, 2018 21:24
Proposed SEP007 approaches for dealing with empty/null public key.

SEP007 Stellar-JS-SDK Integration

Background

As part of the protocol outlined in SEP007, to create a uri without a known source account beforehand, you must specify the source account in the XDR as all zeros.

xdr (required) - A Stellar transaction in XDR format that is base64 encoded and then URL-encoded. If the source account in the xdr is all zeros then the URI handler should replace the source account and sequence number with the user's source account and sequence number before it signs it. If the source account is set and the sequence number is 0 then the URI handler should replace only the sequence number before signing.

Currently this is not possible in the Stellar-JS-SDK.

Overview

Keybase proof

I hereby claim:

  • I am robertdurst on github.
  • I am r_durst (https://keybase.io/r_durst) on keybase.
  • I have a public key ASAQplJiEBCTbetcNR-jo6yHH3FHZBH8ElqheC4N4gGo0wo

To claim this, I am signing this object:

@robertDurst
robertDurst / ShamirSecretShare.rs
Created July 20, 2018 15:24
LaGrange interpolation implementation in rust demonstrating how to calculate f(0) for a given set of points.
// Because of this feature gate, you must use a nightly
// version of rust.
#![feature(euclidean_division)]
#[derive(Debug)]
struct Point {
x: f64,
y: f64,
}
@robertDurst
robertDurst / code.js
Created July 31, 2018 06:06
Code for calculating inflation for an account since a given time.
var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon.stellar.org');
// Make sure date is in # of seconds since unix epoch
async function getInflationForAccountSinceDate(account, time) {
const resp = await server.transactions()
.forAccount(account)
.limit(200)
.order("desc")
.call();
@robertDurst
robertDurst / NERDTree.mkd
Created August 15, 2019 22:01 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@robertDurst
robertDurst / Tree.py
Created September 28, 2019 20:24
Traversal Practice
class Tree:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def inorder(node):
# fill in code
return
// started 8:00 - 8:45/9:00 (while chatting w/ friends)
const START_SIZE = 10;
const BUCKET_LIMIT = 3;
class HashMap {
constructor() {
this.values = new Array(START_SIZE);
this.count = START_SIZE;
this.length = START_SIZE;
@robertDurst
robertDurst / comparison.py
Last active November 3, 2019 18:18
Bubble Sort vs. Comb Sort
import random
import cProfile
def swap(arr, a, b):
arr[a], arr[b] = arr[b], arr[a]
def getNextGap(gap):
gap = (gap * 10) / 13
if gap < 1:
return 1