Skip to content

Instantly share code, notes, and snippets.

View TomLisankie's full-sized avatar

Thomas Lisankie TomLisankie

View GitHub Profile
from random import randint
def random_8_unique_ints_seq():
nums = []
while len(nums) < 8:
new_num = randint(1, 8)
if new_num not in nums:
nums.append(new_num)
return nums
@TomLisankie
TomLisankie / MetaplexDisplay.md
Created October 11, 2021 21:07
Steps for Metaplex NFT Display

So you want to display a Metaplex NFT

This guide will attempt to give an overview of the technical/coding steps that are required to render a Metaplex NFT with any programming language/platform. I'll attempt to write it a programming language-agnostic manner; you'll need to fill in the particular methods of performing the steps with your coding language of choice.

For the purposes of discussion, we'll call the Solana account that holds the Metaplex NFTs the "NFT-Account."

Step 1: Call getTokenAccountsByOwner

The first thing you need to do is call the getTokenAccountsByOwner JSON RPC method as documented here:

@TomLisankie
TomLisankie / System Design.md
Created February 1, 2020 22:00 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@TomLisankie
TomLisankie / longestSubstringWithoutRepeatingCharacters.js
Last active January 15, 2020 03:12 — forked from tombaranowicz/longestSubstringWithoutRepeatingCharacters.js
2 ways of solving "Longest Substring Without Repeating Characters" problem in JavaScript
//SLIDING WINDOW METHOD
var lengthOfLongestSubstring = function(s) {
let count = 0;
let i = 0;
let j = 0;
let end = s.length;
let set = new Set();
;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[prismatic/dommy "1.1.0"]]
:builds
{:app {:target :browser
:output-dir "resources/public/js/compiled"
shadow-cljs - config: /path/to/project/dir/shadow-cljs.edn cli version: 2.8.81 node: v12.13.1
shadow-cljs - server version: 2.8.81 running at http://localhost:9630
shadow-cljs - nREPL server started on port 37065
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (144 files, 1 compiled, 0 warnings, 3.45s)
;; Problem 46
(fn [f]
(fn [& args]
(apply f (reverse args))))
;; Problem 44
(fn [number coll]
(if (> number 0)
(concat (second (split-at (mod (+ (count coll) number) (count coll)) coll)) (first (split-at (mod (+ (count coll) number) (count coll)) coll)))
(concat (second (split-at (mod (- (+ (count coll) 1) number) (count coll)) coll)) (first (split-at (mod (- (+ (count coll) 1) number) (count coll)) coll)))))
(ns cryptopals-clj.core)
(defn hex-string->base64-string
"converts hex string to base64 string"
[original-hex-string]
(let [hex-string->hex-byte-array (fn [hex-string]
(let [convert (fn [string hex-bytes]
(if (empty? string)
hex-bytes

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@TomLisankie
TomLisankie / index.html
Created June 14, 2019 00:00
JavaScript Piano
<body>
<section id="wrap">
<header>
<h1>JS Piano</h1>
<h2>Use your keyboard. Hover for hints.</h2>
</header>
<section id="main">
<div class="nowplaying"></div>
<div class="keys">
<div data-key="65" class="key" data-note="C">