Skip to content

Instantly share code, notes, and snippets.

View aliforever's full-sized avatar
🏠
Working from home

Ali Error aliforever

🏠
Working from home
View GitHub Profile
@aliforever
aliforever / main.go
Created November 12, 2021 12:45
telegram-bot-api pagination example
package main
import (
"fmt"
"strconv"
"strings"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
)
// # "WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper",
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("IntelliJ") do (
for /d %%a in ("%APPDATA%\JetBrains\%%I*") do (
rd /s /q "%%a\eval"
findstr /v /i "evlsprt" %%a\options\other.xml > %%a\options\other1.xml
del /q "%%a\options\other.xml"
ren %%a\options\other1.xml other.xml
)
)
// Node JS
var crypto = require('crypto');
// decrypt
var privKeyPem = `LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBdXpQWGU1ZSs1Mkx6a0VRWnlyTnBiNDZuV0VTMElEZzMrWndVUGxoUlkzZVVmS0NFCjhBV1FiaWNaTC9qR2h3V3NOaGRodUhTTW42ZHhtZWNobXQxSGlVQitrMTkyWnpxdC92VnZyTzBWTDhkM0d6aHMKeElNS29PMVpyNGJ4Q0pFdm4wcFQ5ZUh6OE5ab1FPdWN4UU9OSThFM0dzMkpxRER2eEhNSUFFTERyd29DaS94egppRGRhZTRNakdUa0YxS1hzMndsVUsrNjk2Q1hOc1hscWhkb2N6Tm5qUlh2L3FRbC93ZU1kYWIxa2xhK3pXa1c4CmE3dU1TQlJRcllpUE5Ya2lKMCtDZXQrL0g5QzVkb1N2bjcrU2xJbXNpT3VnWGlGaUQzNlM0SEFkSTIvVXg5dXEKcTM5UnQzZ0hTTTZaYlFoclZHTnROSnVaaE4rVGdzSmV0WHlrRXdJREFRQUJBb0lCQUNtMzR1U1RLNk1MSlRaWQpSdHNxWW12UEFiSWxGWE04dEJTM1dMZVFIUXNxb2Zlb0doZ1hWVm1HOHhFQ3d0TmlTejkrdEhOVDNlYlNmUG1NClRhdmlka2U3RExveEF3VDhTYnhRM0FOUWpuRW9aWDIyZEY3U3lUS1YwbS9RaGJTZ0RsblVTYU81S0JEYTV6N1kKZ3daUXhVcGJpN2s0WnQ0SmtkVll3VWExbWtCT2U2dHl3Z3EvUDl1ZWNYTDlCUkxPcTVUdE9Kdlh1cnY0ckUrRAo0TU12L3czOFphREZnd3VBYUIwQTNBbjIzR1JMRG1EQnBCZk9teVNpdUFiY3FyWGlETFVzZ1pwSWs5WTV2bkQ1ClRmZVYzejhublhMRWx0bDIwWFpFMzRwbmhBOWdq
@aliforever
aliforever / forwarder.py
Created August 17, 2019 20:33
Forward messages from a name to saved messages without marking message as seen in Telegram
# After running the script in logging in to your account, send "forward_unseen:mister_x:10" to your saved messages,
# the bot will then forward 10 last messages of the first user with name mister_x to your saved messages.
# This way you can check what people have sent you without them knowing you did.
from telethon import TelegramClient, events, sync
from telethon.tl.types import PeerUser
api_id = # Your Telegram API id here
api_hash = # Your Telegram API hash here
@aliforever
aliforever / time.go
Last active April 26, 2019 19:48
PHP microtime function equivalent in Golang
// Golang microtime
// Php microtime in golang, go
func microTime() float64 {
loc, _ := time.LoadLocation("GMT")
now := time.Now().In(loc)
micSeconds := float64(now.Nanosecond()) / 1000000000
return float64(now.Unix()) + micSeconds
}

Keybase proof

I hereby claim:

  • I am aliforever on github.
  • I am alierror (https://keybase.io/alierror) on keybase.
  • I have a public key ASCBqbUNGhUzN22koFsPA4JUuEP3xy41RSt4RXdIXkLdmwo

To claim this, I am signing this object: