Skip to content

Instantly share code, notes, and snippets.

@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
\begin{verbatim}
from pythermalcomfort.models import pmv_ppd
from pythermalcomfort.psychrometrics import v_relative
from pythermalcomfort.utilities import met_typical_tasks
from pythermalcomfort.utilities import clo_individual_garments
# input variables
tdb = 27 # dry-bulb air temperature, [$^{\circ}$C]
tr = 25 # mean radiant temperature, [$^{\circ}$C]
v = 0.1 # average air velocity, [m/s]
@T1T4N
T1T4N / react-devtools-safari.md
Last active May 18, 2024 03:06
How to get React Devtools working in Safari Developer Tools in 2023

React DevTools In Safari 2023

Credits: Forked from React DevTools in Safari 2022

Introduction

This is a successful experiment in getting React DevTools working in Safari Developer Tools in Safari 16.3 as of January 2023. Potentially, this process can be used with other extensions that extend the developer tools (e.g. Redux, Vue, etc...).

This is only a proof of concept but hopefully this may open the doors for tools that were previously accessible on other browsers to be now available on Safari spurring for a more open web experience (and debugging) for developers.

Requirements

  • macOS 13.2 Ventura
@kayabaNerve
kayabaNerve / deanon_dero.md
Created May 17, 2024 14:53
Deanonymization of the Dero Network

The Dero Protocol

The protocol uses a pair of rings, one for the senders, one for the receivers, represented as a singular ring. With each transfer, a list of ElGamal ciphertexts is provided for all accounts within the joint ring. This ElGamal ciphertext is formed as r * G, (r * K) + (a * G), where r is some randomness, K is the key for the account the ciphertext is for, and a is the amount.

The Dero Wallet Protocol

Dero offers an 'encrypted message' with every transaction. Even if the user does not explicitly provide one, a message will exist (either with internally provided values or left empty). For the only defined type of message, the message is encoded as the index of the sender, a CBOR-encoded object, and zero-padding. The message is encrypted with the Chacha20 stream created by a key of H(H(r * K) || K) where r is some randomness and K is the key for the account the ciphertext is for.

The Issue

@Klerith
Klerith / vue-instalaciones.md
Last active May 18, 2024 03:02
Instalaciones recomendadas - Curso de Vue.js de cero a experto
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 18, 2024 02:55
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@ih2502mk
ih2502mk / list.md
Last active May 18, 2024 02:54
Quantopian Lectures Saved
@zpoint
zpoint / v2ray_wireguard_netflix_spotify_hulu.md
Last active May 18, 2024 02:53
v2ray + wireguard to unblock gfw and netflix,spotify,hulu

I previously write a gist about how to set up v2ray + openvpn to unblock gfw and netflix

Refers to that gist for more detail.

In short, this a solution to proxy your network to bypass Firewall with stable connections, and also unblock Proxy detection for Netflix/Spotify/etc....

In my use case from China network:

wireguard

@prodamin
prodamin / gist:334e761dd2e879d9f803886a5cd44a82
Created March 27, 2017 12:57 — forked from adammeghji/gist:5637522
Convert a PostgreSQL database from SQL_ASCII to UTF8 encoding
# convert createdb's template to UTF8
echo "UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';" | psql -U postgres
echo "drop database template1;" | psql -U postgres
echo "create database template1 with template = template0 encoding = 'UTF8';" | psql -U postgres
echo "update pg_database set datacl='{=c/postgres,postgres=CTc/postgres}' where datname='template1';" | psql -U postgres
echo "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';" | psql -U postgres
# export and reimport as UTF8
pg_dump -U uniiverse --encoding utf8 mydatabase -f mydatabase_utf8.sql
createdb -U postgres -E utf8 mydatabase_utf8
@gabonator
gabonator / password.txt
Last active May 18, 2024 02:38
HiSilicon IP camera root passwords
Summary of passwords by sperglord8008s, updated November 1. 2020. For login try "root", "default", "defaul" or "root"
00000000
059AnkJ
4uvdzKqBkj.jg
7ujMko0admin
7ujMko0vizxv
123
1111
1234