Skip to content

Instantly share code, notes, and snippets.

View Lh4cKg's full-sized avatar
🐍
Working

Lasha Gogua Lh4cKg

🐍
Working
View GitHub Profile
@Lh4cKg
Lh4cKg / colors.css
Created November 25, 2021 21:47 — forked from robodl/colors.css
Wagtail - Draftail - Multiple color highlighter
.cm-green {
background-image: linear-gradient(30deg,#16d6d9,#96cc29);
}
.cm-blue {
background-image: linear-gradient(30deg,#009cf3,#16d6d9);
}
.cm-pink {
background-image: linear-gradient(30deg,#ff2277,#7a288c);
@Lh4cKg
Lh4cKg / managers.py
Created May 25, 2020 10:15
Python Multiprocessing Workers Architecture
from multiprocessing.managers import BaseManager
class QueueManager(BaseManager):
pass

Keybase proof

I hereby claim:

  • I am lh4ckg on github.
  • I am lh4ckg (https://keybase.io/lh4ckg) on keybase.
  • I have a public key whose fingerprint is FE29 4BC3 ECD7 C92F 67D2 8FE6 D66B 607C E774 A3FA

To claim this, I am signing this object:

@Lh4cKg
Lh4cKg / bug-en.md
Last active February 10, 2020 18:47
Django casing bug, Georgian Script Casing in Python 3.7 and Unicode 11

Georgian Script Casing in Python 3.7 and Unicode 11

The problem is in all versions starting with python 3.7, let's go back a little and follow what happened. So with the new version of Unicode 11 (June 5, 2018) we have some major changes for the Georgian script. Georgian was considered a monocameral (non-casing) script. Therefore, Georgian letters were gc=Lo (Letter, Other) and starting from the version Unicode 11.0, those Georgian letters are now gc=Ll (Letter, Lowercase). In python 3.7 first release (June 27, 2018), we have implementation of Unicode 11 and manipulation on the Georgian scripts (capitalize, titlecasing, uppercase) gives us strange symbols on the output.

ex. shown below

Python 3.7.5 (default, Oct 17 2019, 12:21:00) 
@Lh4cKg
Lh4cKg / numberformat.py
Last active January 23, 2020 11:17
Convert an integer to a string
from django.template import Library
register = Library()
@register.filter(is_safe=True)
def intdivide(value, separator=','):
"""
Convert an integer to a string containing specific separator every three digits.
@Lh4cKg
Lh4cKg / mongodb_backup.py
Created January 22, 2020 07:50
MongoDB Dump And Restore Database With Python PyMongo Driver
import bson
from pymongo import MongoClient
def dump(collections, conn, db_name, path):
"""
MongoDB Dump
@Lh4cKg
Lh4cKg / install_hp.sh
Last active February 12, 2024 21:02
Installing networked HP printer and scanner on Fedora Linux
# docs for more information see the official HPLIP project site here.
# https://developers.hp.com/hp-linux-imaging-and-printing
# Step 1. Update Fedora Linux
# Simply run dnf command:
$ sudo dnf upgrade
# Step 2. Search for HPLIP software
@register.simple_tag
def get_protected_attribute(obj, field):
return obj[field].value()
@Lh4cKg
Lh4cKg / aggregation_lookup.md
Created February 18, 2019 17:16 — forked from bertrandmartel/aggregation_lookup.md
MongoDB $lookup aggregation example

MongoDB $lookup aggregation

SO link

db.votes.aggregate([{
    $lookup: {
        from: "users",
        localField: "createdBy",
        foreignField: "_id",
@Lh4cKg
Lh4cKg / docker_cheat.md
Created February 7, 2019 13:53 — forked from wsargent/docker_cheat.md
Docker cheat sheet