This file contains 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
#!/bin/env python | |
from openai import OpenAI | |
import sys | |
import os | |
import argparse | |
def translate_stdin_to_stdout(target_language, translate_lines=False, translate_po=False, instructions=""): | |
client = OpenAI() |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ice Breaker</title> | |
<link rel="stylesheet" href="https://unpkg.com/mvp.css"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chgibb/[email protected]/css/spinner/three-quarters.min.css"> | |
</head> | |
<body> | |
<header> |
This file contains 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
#define public keys | |
let alicePubKey = base58'5AzfA9UfpWVYiwFwvdr77k6LWupSTGLb14b24oVdEpMM' | |
let bobPubKey = base58'2KwU4vzdgPmKyf7q354H9kSyX9NZjNiq4qbnH2wi2VDF' | |
let cooperPubKey = base58'GbrUeGaBfmyFJjSQb9Z8uTCej5GzjXfRDVGJGrmgt5cD' | |
#check whoever provided the valid proof | |
let aliceSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], alicePubKey ) || sigVerify(tx.bodyBytes, tx.proofs[1], alicePubKey )) then 1 else 0 | |
let bobSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], bobPubKey ) || sigVerify(tx.bodyBytes, tx.proofs[1], bobPubKey )) then 1 else 0 | |
let cooperSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubKey) || sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubKey)) then 1 else 0 |
This file contains 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
#!/bin/bash | |
ADDRESS="$1" | |
TOTAL=$(curl -s -I "https://nodes.lto.network/index/transactions/addresses/$ADDRESS" | grep x-total | awk '{printf "%d",$2}') | |
seq -w 00000 100 $TOTAL | xargs -P 10 -I'{}' curl -s "https://nodes.lto.network/index/transactions/addresses/$ADDRESS?limit=100&offset={}" -o "$ADDRESS.{}.json" | |
jq -s add $ADDRESS.*.json > "$ADDRESS.json" | |
rm $ADDRESS.*.json |
This file contains 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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 RECIPIENT" >&2 | |
exit 1 | |
fi | |
RECIPIENT="$1" | |
WALLET_ADDRESS=$(curl -sS http://localhost:6869/wallet/addresses | jq -r '[0]') |
This file contains 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
#!/bin/bash | |
ADDRESS=$1 | |
MAX_HEIGHT=$(curl -sS http://testnet.lto.network/blocks/height | jq '.height') | |
MIN_HEIGHT=$((MAX_HEIGHT - 1999)) | |
curl -sS "https://testnet.lto.network/addresses/balance/history/$ADDRESS" | jq -r '.[] | (.height|tostring) + "," + (.balance|tostring)' > balance.csv | |
BLOCKS=$(for ((HEIGHT=MIN_HEIGHT; HEIGHT<MAX_HEIGHT; HEIGHT=HEIGHT+100)); do curl -sS "http://testnet.lto.network/blocks/address/$ADDRESS/$HEIGHT/$((HEIGHT + 99))" | jq -r '.[].height'; done) |
This file contains 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
#!/bin/bash | |
ALBUM=$1 | |
mkdir -p "$ALBUM/original" "$ALBUM/new" | |
aws s3 ls "s3://fiestainfo-old-images/albums/$ALBUM/" | awk '{for(i=4; i<=NF; ++i) printf "%s ", $i; print ""}' | grep -v '.DS_Store' > "$ALBUM/list" | |
function resize_image { | |
IMAGE=$1 |
This file contains 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
#!/bin/bash | |
if [ $# -gt 0 ]; then | |
HEIGHT=$1 | |
CONFIG=" | |
url = \"http://node-bs1.lto.network:6869/debug/stateAtHeight/$HEIGHT\" | |
output = \"balances-bs1.json\" | |
url = \"http://node-bs2.lto.network:6869/debug/stateAtHeight/$HEIGHT\" | |
output = \"balances-bs2.json\" |
This file contains 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
from lto.accounts import AccountFactoryED25519 | |
from itertools import permutations | |
address = "3JzSs25zWMomDHmw3jA3v9rpqqxxzmCAd9Hs" | |
words = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"] | |
factory = AccountFactoryED25519('L') | |
def find_insert_word(): | |
print("Changing the position of each word") |
This file contains 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
#!/bin/bash | |
set -e | |
SERVICE="lto" # Change to "lto-testnet" for testnet | |
if [ -z "$1" ]; then | |
echo "USAGE $0 VERSION" >&2 | |
exit 1 | |
fi |
NewerOlder