This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//npm install openai langchain | |
async function loadModules() { | |
const openaiModule = await import("langchain/chat_models/openai"); | |
const schemaModule = await import("langchain/schema"); | |
const { ChatOpenAI } = openaiModule; | |
const { HumanChatMessage, SystemChatMessage } = schemaModule; | |
const chat = new ChatOpenAI({ openAIApiKey: 'sk-YOURKEY', temperature: 0 }); | |
// Now you can use the chat object to interact with the model: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import sys | |
ournum = sys.argv[1] | |
#print("got "+ournum) | |
def is_number(x): | |
if type(x) == str: | |
x = x.replace(',', '') | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q='RGB' | |
P=True | |
O='rb' | |
N=chr | |
L=bytes | |
K=float | |
G=range | |
I=open | |
C=print | |
F=int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Updated and stripped ver of https://github.com/ESultanik/bin2png Evan Sultanik | |
#Quickly convert arbitrary data into/out of .png format. Example: https://i.ibb.co/qgSsgmp/out.png (is an MP3) | |
import math | |
from PIL import Image | |
import sys | |
# print usage, if no arguments are given | |
if len(sys.argv) < 2: | |
print("Usage: %s <input file> <output file>" % sys.argv[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import re | |
import subprocess | |
stats=subprocess.getoutput('gnunet-statistics').split('\n') | |
while True: | |
lines,j=[],[] | |
c=0 | |
for i in stats: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this got me start to finish on ubuntu 19.04 | |
# after some 12 odd hours of hair pulling | |
# it was so tedious i recorded each step once i found | |
# the step, and got it to complete successfully. | |
# no promises it will work 'out of the box' for you. | |
# feel free to steal/revise/comment/gfy | |
sudo apt install git libtool libtool-bin autoconf autopoint \ | |
build-essential libgcrypt-dev libidn11-dev zlib1g-dev \ | |
libunistring-dev libglpk-dev miniupnpc libextractor-dev \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# the absolute least required to make binance api requests in one function. | |
# everything is in this file and only pure python is needed. | |
# can just scroll to bottom and create an apiGet('api/v1/etcetc') call and start | |
# parsing results without spending ten hours learning syntax and workarounds | |
# for some new python module (ccxt) | |
#API Secrets go here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# might need to change instances of 'user' to your username. | |
# add following line to your crontab to have a fresh (ish) bootstrap on hand. | |
# @weekly tar -czf /home/user/projects/bootstrap/bootstrap.tar /home/user/.navcoin4/chainstate /home/user/.navcoin4/blocks | |
navcoin-cli stop | |
echo "Waiting a bit so navcoind has completed..." | |
sleep 10 | |
cd /home/user | |
mkdir tmp_bootstrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import requests | |
import subprocess | |
import json | |
# Check local best block hash against api.navexplorer.com's best hash. | |
# 'navcoin-cli' needs to be in your PATH, and obvs navexplorer.com has to be up. | |
def api_get(endpoint): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os,sys,shutil | |
from playsound import playsound | |
phrase = sys.argv[1] | |
with open('harvard_sentences.txt','w') as f: | |
f.write("some horseshit it never reads this line\n1. "+str(phrase)+"\n") | |
os.system('python synthesize.py') | |
phrase=phrase.replace(" ","") | |
shutil.move('samples/1.wav','backup/'+phrase+'.wav') |
NewerOlder