Skip to content

Instantly share code, notes, and snippets.

View savankaneriya's full-sized avatar
💻
Working on Something

savan kaneriya savankaneriya

💻
Working on Something
View GitHub Profile
@savankaneriya
savankaneriya / gzip.conf
Created October 30, 2021 08:25
GZIP configuration for nginx
# enables GZIP compression
gzip on;
# compression level (1-9)
# 6 is a good compromise between CPU usage and file size
gzip_comp_level 6;
# minimum file size limit in bytes to avoid negative compression outcomes
gzip_min_length 256;
@savankaneriya
savankaneriya / pdf_2_html.py
Created September 9, 2022 12:22 — forked from ivandeex/pdf_2_html.py
convert pdf to html or xml
# https://github.com/scraperwiki/pdfminer/blob/scraperwiki/tools/pdf2html.cgi
import pdfminer
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
from pdfminer.converter import HTMLConverter, TextConverter
from pdfminer.layout import LAParams
rsrcmgr = PDFResourceManager()
laparams = LAParams()
converter = HTMLConverter if format == 'html' else TextConverter
device = converter(rsrcmgr, out_file, codec='utf-8', laparams=laparams)
process_pdf(rsrcmgr, device, in_file, pagenos=[1,3,5], maxpages=9)
@savankaneriya
savankaneriya / script
Created September 13, 2022 06:21
Create symlink for plugin in wordpress development
/*
* Given the repository for the 'WordPress Plugin Boilerplate' and knowing that the actual
* plugin resides in the `plugin-name` directory, then you'd need to do the following:
*
* 1. Navigate to `wp-content/plugins`
* 2. Execute the following terminal command:
*/
> ln -s WordPress-Plugin-Boilerplate/plugin-name/ plugin-name