Skip to content

Instantly share code, notes, and snippets.

View Visionario's full-sized avatar

Visionario Visionario

View GitHub Profile
@UlugbekMuslitdinov
UlugbekMuslitdinov / urls.py
Last active January 22, 2024 03:12
How to connect PyTelegramBotAPI with Django
from bot.views import bot
from django.urls import path
urlpatterns = [
path('ANY-RANDOM-LINK/', bot, name="bot"),
]
[
{
"value": 1,
"first": "bar",
"second": "bar",
"third": "bar"
},
{
"value": 2,
"first": "grape",
@andrsd
andrsd / arch-mac-mini.md
Last active April 9, 2024 06:48
Install Arch linux on Mac Mini (late 2012)

Install Arch Linux on Mac mini

We will be creating dual boot for OS X and Linux with no special boot loader. For other setup, refer to [1]. We will keep all data on an external hard drive, so we do not need huge amount of space for the linux system. We will install from an USB thumb drive (will need at least 1GB in size), newer Minis do not have CD roms.

Prepare the disk in Mac OS X (El Capitan)

@leandrotoledo
leandrotoledo / main.py
Last active February 2, 2024 00:08
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
@erasmospunk
erasmospunk / gist:4dac398935e9dc86eed1
Last active March 11, 2024 08:12
Coinomi wallet coin support

Overview - Adding support for a new currency in Coinomi

The Coinomi wallet can support any kind of cryptographic currency because it adopts the model of a thin wallet.

A thin wallet will delegate most of the complexity to a trusted server, while still maintaining control of the private keys by using a deterministic key chain BIP44. It is different than SPV in that it doesn't need to perform any header or transaction merkle root validations (although it is optionally possible).

The advantage of a thin wallet is that it is light weight and can easily work with low-specs devices and consumes small amounts of network bandwidth. Some assets like Peercoin, CounterParty or Mastercoin can only work with this model because as SPV is not enough to validate transactions. The disadvantage is that it needs a trusted service to get the state of the network. A known attack for an SPV wallet is to hide transactions, in a thin wallet it is possible to al

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active June 21, 2024 07:34
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1