Skip to content

Instantly share code, notes, and snippets.

View ilius's full-sized avatar

Saeed Rasooli ilius

  • Iran
  • 03:48 (UTC +03:30)
View GitHub Profile
# -*- coding: utf-8 -*-
# http://www.octopus-studio.com/download.en.htm
from pyglossary.compression import compressionOpen as c_open
from pyglossary.option import (
EncodingOption,
BoolOption,
FileSizeOption,
)
from pyglossary.core import log
@ilius
ilius / psql_mem_tuner.py
Last active March 7, 2024 06:20
PostgreSQL Memory Tuner
total_memory_percentage = 20.0
total_memory_max_megabytes = 8000
memory_params_percentage = {
'shared_buffers': 25.0,
'work_mem': 1.0,
'maintenance_work_mem': 12.0,
'effective_cache_size': 62.0,
}
@ilius
ilius / job-ad-guide.md
Last active March 7, 2024 06:15 — forked from hristian-carabulea/Guide.md
A Guide to Software Developer Job Advertisements
Job Description Actual meaning
A fast-paced environment Your job will be constant firefighting
A market leader Recently started making a profit
Able to work with minimal spervision You'll be the one we blame when something goes wrong
An Agile team We have daily stand-ups
Dynamic environment Our leadership keeps changing priorities
Must be a team player Must not question authority
Ninja You do all the work alone
Passionate You wil
@ilius
ilius / dict-links.txt
Last active March 7, 2024 06:13
Dict Links
@ilius
ilius / docker-functions.sh
Last active March 7, 2024 06:11
Docker Bash functions
function docker-running-by-name() {
# docker ps --filter name=$1 --quiet # does not always work!
docker ps | grep "$@" | sed 's/ .*//' | head -n1
}
function docker-shell-to-name() {
ID=$(docker-running-by-name $1)
if [ -z $ID ] ; then
echo "No running container by image name $1"
return
@ilius
ilius / main.go
Last active February 15, 2024 15:20
Go generators
// You can edit this code!
// Click here and start typing.
package main
import "fmt"
import "io"
type Gen interface {
Next(args any...) (any, error) // EOF
End() bool
@ilius
ilius / article-style.css
Last active February 11, 2024 18:42 — forked from bangedorrunt/article-style.css
GoldenDict Dark Theme
body
{
margin-top: 1px;
margin-right: 3px;
margin-left: 2px;
margin-bottom: 3px;
background: #201F1F;
color: white;
font-family: Bookerly, Segoe UI, Palatino Linotype, Arial Unicode MS;
}
@ilius
ilius / jalali-plpgsql.sql
Last active January 18, 2024 14:06
Jalali Date Conversion in PL/pgSQL
create or replace function epoch_to_jd(float) RETURNS int as $$
BEGIN
return ($1 / (24*3600) + 2440588)::int;
END;
$$ LANGUAGE plpgsql;
create or replace function timestamp_to_jd(timestamp with time zone) RETURNS int as $$
BEGIN
return epoch_to_jd(extract (epoch from $1));
@ilius
ilius / appledict-bin-to-slob.py
Created November 10, 2023 07:59
appledict-bin-to-slob.py
#!/usr/bin/env python
import sys
from os.path import extsep, join, splitext
from pyglossary import slob
from pyglossary.core import cacheDir
from pyglossary.entry import Entry
from pyglossary.glossary_v2 import Glossary
from pyglossary.plugins.aard2_slob import Writer as SlobWriter