Skip to content

Instantly share code, notes, and snippets.

View kritik's full-sized avatar

Vladimir Krylov kritik

  • PerfectLine
  • Tallinn, Estonia
View GitHub Profile
@kritik
kritik / printerbot.py
Last active January 27, 2022 19:11 — forked from DeNcHiK3713/printerbot.py
Telegram bot for printer (Linux)
import os
import pathlib
import logging
from telegram.ext import Updater
from telegram.ext import Filters
from telegram.ext import CommandHandler
from telegram.ext import MessageHandler
# This is the Telegram Bot that prints all input documents. It can print pdf and txt files.
# Before sending files for printing user must enter the password by command "/auth <password>".
@kritik
kritik / gist:1256399
Created October 1, 2011 17:47 — forked from crosebrugh/gist:1128448
Using nested_form_for with rails_admin
class Product < ActiveRecord::Base
has_many :material_product_mappings, :dependent => :destroy, :inverse_of => :product
has_many :materials, :through => :material_product_mappings, :autosave => true
accepts_nested_attributes_for :material_product_mappings # really needed feature
#...
end