Skip to content

Instantly share code, notes, and snippets.

@Pitasi
Pitasi / check_telegram_signature.js
Last active March 12, 2024 15:06
Telegram website login widget, signature check sample using Node.js
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa,
// thanks for improving code style
const { createHash, createHmac } = require('crypto');
const TOKEN = "ABC:12345...";
// I prefer get the secret's hash once but check the gist linked
// on line 1 if you prefer passing the bot token as a param
const secret = createHash('sha256')
.update(TOKEN)
@Pitasi
Pitasi / settings.json
Created February 19, 2018 10:26
Visual Studio Code settings
{
"git.autofetch": true,
"editor.fontFamily": "Operator Mono Medium",
"terminal.integrated.fontFamily": "Hack",
"editor.fontSize": 16,
"editor.fontLigatures": true,
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"editor.formatOnPaste": true,
@Pitasi
Pitasi / policies.json
Created May 21, 2018 18:33
Google Chrome automatically select certificate
# Make Google Chrome automatically select a self signed certificate
# Linux: create /etc/opt/chrome/policies/managed/policies.json with the following content
{
"AutoSelectCertificateForUrls": [
"{\"pattern\":\"https://[.*]zerynth.com\",\"filter\":{}}"
]
}
@Pitasi
Pitasi / caps-lock-command-esc.json
Last active January 7, 2022 17:09
Mac OS Karabiner rule for remapping Caps Lock to Command and Escape
{
"title": "CapsLock -> Cmd/Ctrl based on current app",
"rules": [
{
"description": "CapsLock -> Cmd/Ctrl based on current app",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",