- https://news.ycombinator.com/user?id=lifekaizen
- @enxeth
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
# https://github.com/MinaGhadimiAtigh/hyperbolic_representation_learning/blob/main/notebooks/2_Hyperbolic_Image_Embeddings.ipynb | |
class Config: | |
def __init__(self, shot=1, lr=0.001, step=50, gamma=0.8, c=0.05, model="convnet", hyperbolic = True, dim=1600, | |
query=15, way=5, validation_way=5, temperature=1, dataset="CUB", lr_decay=True, max_epoch=200): | |
self.lr = lr # learning rate | |
self.lr_decay = lr_decay # Boolean, if to perform learning rate scheduler | |
self.step_size=step # Period of learning rate decay | |
self.gamma = gamma # Multiplicative factor of learning rate decay | |
self.dataset= dataset # Dataset name |
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
import pyperclip | |
def copy_question_rating_to_clipboard(answer: str, question: str) -> None: | |
rating_prompt = ( | |
f"On a scale of 0 to 100, with 100 being perfect and 0 being completely wrong, " | |
f"rate how well this response `{answer}` answers this question `{question}`? " | |
"Give only the number rating." | |
) | |
pyperclip.copy(rating_prompt) |
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
#!/bin/zsh | |
grn="$(tput setaf 2)" | |
didcopymsg='👆 copied to clipboard 📋 ✅ 🐶' | |
alias copy="tr -d '\n' | pbcopy" | |
alias DATE='echo "$(date '\''+%F %T %Z'\'')" | tee /tmp/output.txt; cat /tmp/output.txt | copy; rm /tmp/output.txt; echo "$grn $didcopymsg"' | |
DATE | |
# 2023-01-07 21:08:53 PST | |
# 👆 copied to clipboard 📋 ✅ 🐶 |
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
# Count unique wallets with votes recorded in all proposals | |
# for orangedaoxyz.eth | |
# | |
# https://docs.snapshot.org/graphql-api | |
# | |
import requests | |
import pandas as pd |
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
# pip install | |
nbstripout | |
# .git/config | |
[include] | |
path = ../.git.config/repo.config | |
# .git.config/repo.config | |
[filter "nbstripout"] | |
clean = venv/bin/nbstripout |
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
import pickle | |
a = {'hello': 'world'} | |
with open('data.pickle', 'wb') as file: | |
pickle.dump(a, file) | |
with open('data.pickle', 'rb') as file: | |
b = pickle.load(file) |
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
ipfs cid format -v 1 -b base32 [CID] |
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
ipfs dag get bafybeiccfclkdtucu6y4yc5cpr6y3yuinr67svmii46v5cfcrkp47ihehy | python -m json.tool |
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
# add | |
git config --global alias.st status | |
# view | |
git config --get-regexp alias |
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
<!--- cspell:dictionaries python ---> | |
<!--- cspell:ignore variable_name ---> |
NewerOlder