Skip to content

Instantly share code, notes, and snippets.

View dpschen's full-sized avatar

Dominik Pschenitschni dpschen

View GitHub Profile
(function () {
function loadZendeskChat(callback) {
var zdscript = document.createElement('script');
zdscript.setAttribute('id','ze-snippet');
zdscript.src = 'https://static.zdassets.com/ekr/snippet.js?key=XXX-XXX-XXX-XXX';
(document.getElementsByTagName('body')[0]).appendChild(zdscript);
window.zdonload = setInterval(function(){
if(typeof zE !== "undefined" && typeof zE.activate !== "undefined") {
@dpschen
dpschen / compress-pdf-with-gs.md
Created June 12, 2021 11:08 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@dpschen
dpschen / font-smoothing-on-high-dpi-media.css
Last active December 7, 2019 11:29 — forked from marcedwards/high-dpi-media.css
Use more beautiful font smoothing on high dpi media devices
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */