Skip to content

Instantly share code, notes, and snippets.

View Tknott95's full-sized avatar
🍀

TKnott Tknott95

🍀
View GitHub Profile
@Tknott95
Tknott95 / query_ex_00.MD
Created February 23, 2023 05:41
cardano-db-sync query example to interact with ada handles
-- ADA HANDLES FROM STAKE-KEY
SELECT convert_from(multi_asset.name, 'UTF8') FROM utxo_view JOIN stake_address ON stake_address.id = utxo_view.stake_address_id RIGHT JOIN tx_metadata ON utxo_view.tx_id = tx_metadata.tx_id RIGHT JOIN ma_tx_mint ON ma_tx_mint.tx_id = tx_metadata.tx_id LEFT JOIN multi_asset ON ma_tx_mint.ident = multi_asset.id WHERE view = ? AND multi_asset.policy='\xf0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a';

(test skey on preview: 'stake_test1urc63cmezfacz9vrqu867axmqrvgp4zsyllxzud3k6danjsn0dn70')

 -- w/ naming shortened -- 
SELECT convert_from(ma.name, 'UTF8') FROM utxo_view uv JOIN stake_address sa ON sa.id = uv.stake_address_id RIGHT JOIN tx_metadata txm ON uv.tx_id = txm.tx_id RIGHT JOIN ma_tx_mint ON ma_tx_mint.tx_id = txm.tx_id LEFT JOIN multi_asset ma ON ma_tx_mint.ident = ma.id WHERE view = ? AND ma.policy='\xf0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a';

@Tknott95
Tknott95 / gpt.py
Created February 23, 2023 05:38
chatGPT Python CLI app. Use pyinstaller or cython to compile a binary if wanting to run with "gpt".
import openai
openai.api_key = "<YOUR-API-KEY-HERE>"
def makeGPT(prompt_using):
completion = openai.Completion.create(
engine="text-davinci-003",
prompt=prompt_using,
max_tokens=1024,
n=1,
@Tknott95
Tknott95 / nix_single_user.MD
Last active June 7, 2023 08:02
cannot connect to socket at '/nix/var/nix/daemon-socket/socket': No such file or directory

FOR SINGLE USER INSTALL

cannot connect to socket at '/nix/var/nix/daemon-socket/socket': No such file or directory

remove nix - stop daemon - remove env vars trying to run multi-user style via daemon
if you are trying to remove a multi user install on linux and revert to a single user install 
you need to remove your NIX_REMOTE variable
or just set it to export NIX_REMOTE=

so this is blank and not calling the daemon - as you are installing without it for single user
  “Through the darkness of futures past
  The magician longs to see;
  One chants out between two worlds
  ‘Fire walk with me.’”
@Tknott95
Tknott95 / fleece.MD
Created March 24, 2021 13:11
Jackie Kennedy Poetry
The lights glowed inside, soon supper would ring
And he would go home where his father was King.

But no he was here with the wind and the sea
And all the things he was going to be.

He would build empires
And he would have sons
Others would fall
Art for the gun room(anti-war art - paradox- not beliefs just MY HUMOR)
  Spider of the Evening (dali)  https://www.dalipaintings.com/spider-of-the-evening.jsp
  Guernica (picasso the overrated allegory of fracture) guernica
@Tknott95
Tknott95 / Durer.md
Last active October 10, 2020 07:35

such tools sit idle whilst in melancholic limbo - axiomatic ode to durer

@Tknott95
Tknott95 / archetypal.MD
Last active February 4, 2020 01:26
Monomyths, Campbell; Hero's Journey