Skip to content

Instantly share code, notes, and snippets.

View dmitrymomot's full-sized avatar
🤨

Dmytro Momot dmitrymomot

🤨
View GitHub Profile
@dmitrymomot
dmitrymomot / specification.go
Created May 27, 2023 12:25 — forked from AlexanderGrom/specification.go
Golang Pattern Specification (sketch)
// Pattern Specification
//
// In the following example, we are retrieving invoices and sending them to a collection agency if
// 1. they are overdue,
// 2. notices have been sent, and
// 3. they are not already with the collection agency.
// This example is meant to show the end result of how the logic is 'chained' together.
//
// This usage example assumes a previously defined OverdueSpecification class
// that is satisfied when an invoice's due date is 30 days or older,
@dmitrymomot
dmitrymomot / rsa_util.go
Created March 27, 2023 17:43 — forked from miguelmota/rsa_util.go
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirect</title>
<script type="text/javascript">
function redirectionJavascript() {
@dmitrymomot
dmitrymomot / MetaplexDisplay.md
Created December 3, 2021 13:53
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:

@dmitrymomot
dmitrymomot / rinkeby-peers-list.txt
Created October 12, 2021 16:07 — forked from adyliu/rinkeby-peers-list.txt
get the peers of rinkeby of ethereum
> console.log(admin.peers.map(function(e){return 'admin.addPeer("enode://'+e.id+'@'+e.network.remoteAddress+'");'}).sort().join('\n'))
admin.addPeer("enode://0db812a93f04c5d255d6b49e2982d682de95fb4d627cb71b1ae09c95ccd142cbfd1e4d81de8f6abd53d7039f71d1b76791637550b8457ccb75ab84924a3427a6@35.170.185.206:30303");
admin.addPeer("enode://15512c6ddd95ade68b6825c464cd076f1ef1b9ccd6675fc6c1a64d9131980e0219fe616c8878a7e9d815df96b6635d90ee2a4ec3a14ec88d4e27839d912f9186@35.236.199.169:30303");
admin.addPeer("enode://1f6dcd2e10a93b7373fd17a715d1a337f73a2a6807a358d2ab0bf9c9a70e78997df4d32468fa1886a8158a947ab44998fa6ca34c53c543bb557024ada2e687eb@34.203.75.150:30303");
admin.addPeer("enode://22745f606bf7846714bb55f0a98437e2b09da1928647965ef511d908392c4110e0a7709c2cc1630b48ff074cf0d519ede1d1b124a4f88aa21b794ddc0e7052e3@34.219.84.192:18546");
admin.addPeer("enode://2ca86aaa816920575eca798a30ee657dcc593a5420c20d129f9008ffe5432e54901f4f0846bb9a88ccde5d8531f14f22528b2ea314386815531f98c51c7818ff@18.234.144.172:30303");
admin.addP
admin.addPeer("enode://da0c61fe14ba9da1a9835b59d811553d21787448724cfe6412bc17f0b14586df91826d8286b2137342d09a8631df5ea548cf301294b05657c2a90f9c3d526721@143.198.119.44:30303");
admin.addPeer("enode://3e2287c6caf363357efc600611ccb777e6997ef8b749b1f87e94d3a7d2b466bbefba163b0620c88804f18bc70cfbe68538720ac2644fc1c970848488cdca0c7a@143.198.114.251:30303");
admin.addPeer("enode://15ea76b5d30ce9eaabf6a9a8fe5ca0ff032534d296b5b8ca6e00a730d08a4aaa019077c382a6b2d08ebc7cf6f8eb888f5e00e0dd378798e3459a555538654370@157.230.6.79:30303");
admin.addPeer("enode://2e718763172902a8fa4bcdda45f77a5c2688de5230e184d154e4867922b8f6ad23e1016379715cb5f55f6c79060563f93896035e35dfb47361d08599d4908ae8@143.198.118.178:30303");
admin.addPeer("enode://9d45f21eeb37bd5555fac0c4094ae3d4d144d93e2313aeb891bf3054b0dcf6ca817961ed29ea1de00389b5c36dc6bbe9b00443e367b16ed8ba251cea6c242044@94.176.237.140:30303");
admin.addPeer("enode://2493b5b8407ccb1c448d7ad358e838066640f273442730caf80acde2fe98522b1d9dcebd2dc982efe44911a49779888fe72defc181c29596facff05e1
@dmitrymomot
dmitrymomot / change_primary_key.md
Created September 24, 2021 09:43 — forked from scaryguy/change_primary_key.md
How to change PRIMARY KEY of an existing PostgreSQL table?
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of  your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
@dmitrymomot
dmitrymomot / pg_available_extensions.txt
Created May 17, 2020 10:13 — forked from peterc/pg_available_extensions.txt
Which Postgres extensions are available on DigitalOcean's new managed PostgreSQL service?
defaultdb=> SELECT * FROM pg_available_extensions;
name | default_version | installed_version | comment
------------------------------+-----------------+-------------------+---------------------------------------------------------------------------------------------------------------------
aiven_extras | 1.0.2 | | aiven_extras
plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language
btree_gist | 1.5 | | support for indexing common datatypes in GiST
tcn | 1.0 | | Triggered change notifications
seg | 1.3 | | data type for representing line segments or floating-point intervals
pgrowlocks | 1.2 |
@dmitrymomot
dmitrymomot / px-rem-tw.csv
Created March 27, 2020 17:29 — forked from trevorgreenleaf/px-rem-tw.csv
PX to REM'S to TAILWIND CSS
PX REM TW
4 0.25 1
8 0.5 2
16 1 4
32 2 8
48 3 12
64 4 16
80 5 20
96 6 24
112 7 28