Skip to content

Instantly share code, notes, and snippets.

@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",
@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 / 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 / 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)
module.exports = {
// text
"i did not hit her": { type: 'text', value: 'https://www.youtube.com/watch?v=zLhoDB-ORLQ'}
// gif
"nodejs": { type: 'gif', id: 'CgADBAADLQIAAlnKaVMm_HsznW30oQI' },
// sticker
"woah": { type: 'sticker', id: 'CAADAgAD5gADJQNSD34EF_pwQMgbAg' },
}
@Pitasi
Pitasi / main.js
Last active November 6, 2017 10:29
https://anto.pt/2017/11/05/Telegram-bots-with-Node-js/ - A simple Telegram bot built with Telegraf.js
// Include Telegraf module
const Telegraf = require('telegraf');
// Create a bot using TOKEN provided as environment variable
const bot = new Telegraf(process.env.TOKEN);
// Import replies file
const replies = require('./replies')
// Extract reply_to_message.message_id field from Telegraf ctx
@Pitasi
Pitasi / keybase.md
Last active August 19, 2018 18:32
Just a proof so you are sure that's really me on keybase.io

Keybase proof

I hereby claim:

  • I am pitasi on github.
  • I am zaphodias (https://keybase.io/zaphodias) on keybase.
  • I have a public key ASA4EctrOPmSX3A-BuN3rfqY7f88uhisdbmAAGWgtlENnQo

To claim this, I am signing this object:

@Pitasi
Pitasi / boxstarter.txt
Created August 1, 2017 11:21
boxstarter.org script
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
cinst googlechrome
cinst vlc
cinst 7zip
cinst ccleaner
cinst steam
cinst spotify
@Pitasi
Pitasi / hotkeys.ahk
Created July 13, 2017 16:44
Special characters shortcuts for Windows - using AutoHotKeys
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
<^>!'::Send, ``
<^>!ì::Send, ~
#if getkeystate("capslock","t")
à::SendRaw, À
@Pitasi
Pitasi / RettangoloArrotondato.fsx
Last active October 12, 2016 19:46
Classe per creare facilmente rettangoli (filled) con angoli smussati.
open System.Windows.Forms
open System.Drawing
let f = new Form(TopMost=true, Text="Ciao")
f.Show()
type Style = Filled | Border
type RettangoloArrotondato() =
inherit UserControl()