Skip to content

Instantly share code, notes, and snippets.

View squizduos's full-sized avatar
💭
Senior Bitard Developer

Semyon Bochkaryov squizduos

💭
Senior Bitard Developer
View GitHub Profile
@Birdi7
Birdi7 / callback_data_factory_simple.py
Last active October 29, 2024 18:25
A simple example of usage of callback data factory from aiogram
"""
This is a simple example of usage of CallbackData factory
For more comprehensive example see callback_data_factory.py
"""
import asyncio
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
@yougg
yougg / proxy.md
Last active May 19, 2025 14:26
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@unnikked
unnikked / README.md
Last active June 2, 2025 10:16
How to host your Telegram bot on Google App Script

Telegram Bot on Google App Script

This is the source code of one of my blog post. To read the full blog post please click here.

@brock
brock / psql-with-gzip-cheatsheet.sh
Last active May 14, 2025 13:12
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@dangtrinhnt
dangtrinhnt / excel_utils.py
Created August 8, 2015 00:59
Excel file to list of dictionaries in Python
import openpyxl
import string
def index_to_col(index):
return string.uppercase[index]
def excel_to_dict(excel_path, headers=[]):
wb = openpyxl.load_workbook(excel_path)
sheet = wb.get_sheet_by_name('Sheet1')
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@hezhao
hezhao / twitter_pin_auth.py
Created February 12, 2013 18:45
Twitter PIN-based authorization using tweepy
### See PIN-based authorization for details at
### https://dev.twitter.com/docs/auth/pin-based-authorization
import tweepy
consumer_key=<your_app_consumer_key>
consumer_secret=<your_app_consumer_secret>
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)