Skip to content

Instantly share code, notes, and snippets.

View dpschen's full-sized avatar

Dominik Pschenitschni dpschen

View GitHub Profile
@dpschen
dpschen / findDuplicatesInOnetab.js
Last active April 10, 2024 21:42
Find duplicates links in OneTab
(function findDuplicatesInOnetab() {
const isOneTab = document
.querySelector("title")
?.innerHTML.includes("OneTab"); // cheap OneTab check
if (!isOneTab) {
alert("Run this script in a OneTab tab");
return;
}
const getOneTabLinks = () => [
(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 / Migrate3DProjectToGitLFS.md
Last active December 21, 2023 11:40
Migrate Unity / Unreal Project to Git LFS

Migrate Unity / Unreal Project to Git LFS

Note

  • If you convert to LFS for an existing repository, you will change the history, so the SHA of changed commits changes!!
  • That is fine for archiving purposes, as long as it is only about looking up the history.
  • All historic states should still work, but you can no longer reference them via SHA.
  • You should not use bfg-repo-cleaner because it's not as well supported and maintained anymore compared to git lfs migrate

Steps

@dpschen
dpschen / BackupFirefoxSync.md
Last active December 9, 2023 12:01
Hacky way to export synced tabs of Firefox Sync / Weave and import them in OneTab

Hacky way to export synced tabs of Firefox Sync / Weave and import them in OneTab

Background

I am guilty beeing a tab messy and was searching for a while for a good solution to move my open tabs to OneTab. Especially on mobile the tab situation was extremely bad. When I realized that I had over 3000 (!!) tabs on my iPhone opened I acknowledge that I got to do something.

First I tried to just open the tabs in Firefox. When you rightclick a device on the "Synced Tabs" sidebar there is an "Open all tabs" entry. For 3000 tabs already my computer was already overloaded when opening them… Closing every other open program and removing every browser extension other then blockers also didn't do the trick. After some time the tabs seemed to be in an open state, but Firefox was not really responding. I tried closing the tabs via OneTab and also to save them all as bookmark via Bookmarks -> Bookmark all Tabs but that also didn't work.

@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 / RemovePageOnetab.js
Last active March 1, 2021 13:54
This is a simple script to find and remove entries from OnTab
function triggerMouseEvent(node, eventType) {
const clickEvent = document.createEvent('MouseEvents');
clickEvent.initEvent(eventType, true, true);
node.dispatchEvent(clickEvent);
}
// This is a helper that you can use to remove duplicate entries on a OneTab page.
// Use like this:
// const url = "https://www.zeit.de/index";
// removeDuplicatePages(url)
@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 */