Skip to content

Instantly share code, notes, and snippets.

View ivan's full-sized avatar
🕸️

Ivan Kozik ivan

🕸️
View GitHub Profile
@ivan
ivan / ignore-pdf-permissions.patch
Created January 21, 2019 01:15
Chromium: ignore PDF permissions that restrict copying text and printing
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 8c3a4691ca5b..1bf4c4eabb7c 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2299,35 +2299,7 @@ std::string PDFiumEngine::GetLinkAtPosition(const pp::Point& point) {
}
bool PDFiumEngine::HasPermission(DocumentPermission permission) const {
- // PDF 1.7 spec, section 3.5.2 says: "If the revision number is 2 or greater,
- // the operations to which user access can be controlled are as follows: ..."
@ivan
ivan / grab-anchor-episode.sh
Last active May 16, 2024 22:16
Download a podcast episode from anchor.fm
#!/usr/bin/env bash
# Download a podcast episode from anchor.fm
#
# Usage:
# grab-anchor-episode "https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val" # (m4a example)
# grab-anchor-episode "https://anchor.fm/free-chapel/episodes/Are-You-Still-In-Love-With-Praise--Pastor-Jentezen-Franklin-e19u4i8" # (mp3 example)
#
# anchor.fm serves a list of m4a or mp3 files that need to be concatenated with ffmpeg.
#
@ivan
ivan / notes.md
Last active February 5, 2023 20:23
Japan travel notes

I visited Japan for the first time March 13-28 2019, here are some general notes from the trip.

  • Trip duration: I walked a lot (sometimes 19 km/day for several days) up and down hills, to and from train stations; this was tiring enough that it was a mistake to stay for 14 days; I should not have stayed for longer than 9-10 days; this would have saved money on the JR pass (7 days instead of 14 days) and hotels.

  • https://www.jalan.net/ seemed to have the best prices and largest selection of hotels. Book at least two months early for good+inexpensive options.

  • I did not have a problem with smoke in any of my non-smoking hotel rooms in Henn na Hotel Tokyo Akasaka (100% non-smoking), Hotel IL Verde Kyoto, Hotel Intergate Hiroshima, Hotel Trend Kanazawa Ekimae, or Fudo-in in Koyasan.

  • There are a lot of smokers (sometimes in areas where it is forbidden to smoke), but their smoke was never a real problem for me.

@apieceofbart
apieceofbart / typescript-advanced.ts
Last active August 26, 2022 14:27
Typescript advanced examples and common gotchas
// EXAMPLE 1
// Let's say you want to create a function that returns different types based on argument passed. Contrived example:
function returnNumberOrString(returnString: boolean) {
if (returnString) {
return "42" as string // cast to string to avoid literal type
}
return 42 as number // cast to number to avoid literal type
}
@ivan
ivan / use-ctrl-j-to-open-downloads.patch
Last active February 25, 2023 09:17
Firefox: use ctrl-j to open downloads on Linux
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index c90f3aa340ef..fcd9f17e9971 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -129,11 +129,10 @@
#
# Search Command Key Logic works like this:
#
-# Unix: Ctrl+K (cross platform binding)
-# Ctrl+J (in case of emacs Ctrl-K conflict)
@ivan
ivan / xfce4-panel-window-buttons-icon-size.patch
Last active November 4, 2021 21:05
xfce4-panel: window buttons: fix tiny icons when labels are enabled
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 74119d1a..e694f651 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -651,7 +651,7 @@ xfce_tasklist_get_window_icon (WnckWindow *window,
{
GdkPixbuf *pixbuf;
- if (show_labels || type == CHILD_TYPE_GROUP_MENU || size <= 31)
+ if (size <= 31)
@sonowz
sonowz / fix-vscode-remote.nix
Created February 9, 2020 01:38
Fix vscode remote error when doing SSH into NixOS machine
with import <nixpkgs> {};
let
pname = "fix-vscode-remote";
script = pkgs.writeShellScriptBin pname ''
if [ -z "$1" ]; then
echo "Please specify username."
exit 1
fi
@tomhicks
tomhicks / plink-plonk.js
Last active May 15, 2025 13:25
Listen to your web pages
@MarkArts
MarkArts / plink-plonk.js
Last active January 3, 2024 15:20 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@maxrpeterson
maxrpeterson / plink-plonk.js
Last active August 31, 2023 08:31 — forked from tomhicks/plink-plonk.js
Listen to your web pages