Skip to content

Instantly share code, notes, and snippets.

@agharbeia
agharbeia / fill_unmerger_gaps.py
Last active April 19, 2021 22:41
LibreOffice Calc macro in Python to fill empty column cells to value on top
# This is LibreOffice Calc macro to set the values of empty cells in
# a column to the value of the first non-empty cells above the empty range.
# It is meant to be used to normalise table rows after unmerging cells
# in compound tables, thus converting them to simple tables that can then
# be algorithmically processed or exported to tabular formats such as CSV.
#
# Themacro is authored by Ahmad Gharbeia<ahmad@gharbeia.org>
# on 2020-05-19 and is licensed under GPL 3.0 license.
#from __future__ import unicode_literals
@agharbeia
agharbeia / extract-image-from-page-pdf.sh
Created October 13, 2017 12:46
A shel script to extracts images from the passed PDF file using pdfimages, and further process them.
#!/bin/bash
## By Ahmad Gharbeia, January 2016. Licensed under GPL version 3.0
## Extracts images from the passed PDF file using pdfimages.
## Additionally, converts PNM files (PBM and PPM) to PNG and optimises the resulting file using pnmtopng and pngcrush respectively.
## JPEG images resulting from the extraction of DCT images from the source PDF, are left unchanged.
dir=${1:-'.'}
shopt -s nullglob
@agharbeia
agharbeia / gist:a550b750435268da9b161315a6b16385
Created September 26, 2017 07:39
PoO: onename.com/gharbeia
Verifying that "gharbeia.id" is my Blockstack ID. https://onename.com/gharbeia
@agharbeia
agharbeia / base62codec.py
Last active December 28, 2016 18:59 — forked from adyliu/base62.py
Base62 encode/decode tools (convert number to string)
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Base62 tools (convert number <=> string)
# v1.0/20161228
# python 2.x/3.x supported
#
# based on work by Ady Liu <imxylz@gmail.com>
#author: Ahmad gharbeia <ahmad@arabdigitalexpression.org>
#github: github.com/agharbeia
@agharbeia
agharbeia / onename.md
Last active March 2, 2016 10:14
onename.com proof

Keybase proof

I hereby claim:

  • I am agharbeia on github.
  • I am gharbeia (https://keybase.io/gharbeia) on keybase.
  • I have a public key whose fingerprint is A68A B4A5 1607 BA5A 1361 03D2 7AA8 5404 923F 205A

To claim this, I am signing this object: