Skip to content

Instantly share code, notes, and snippets.

View ssaavedra's full-sized avatar

Santiago Saavedra ssaavedra

View GitHub Profile
@ssaavedra
ssaavedra / 57-add-emoji-support.conf
Created June 19, 2016 10:36
Add Emoji to Linux Fontconfig
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
EmojiOne Color SVGinOT Font
Author: Santiago Saavedra <ssaavedra@gpul.org>
License: CC0
Year: 2016
Install:
#!/bin/bash
# "Repair" VSCode WSLServer script to include genie invocation
# Author: Santiago Saavedra <info@ssaavedra.eu>
# License: Public Domain or CC0
patch_file () {
patch -r- -F0 "$1" <(cat <<EOF
--- /dev/null 2022-02-15 00:14:03.180843900 +0100
+++ $1 2022-03-06 13:07:22.380000000 +0100
@ssaavedra
ssaavedra / diffmatcher.py
Last active July 22, 2021 15:42
DiffMatcher is a tool to check an input against a database of known variants.
'''
DiffMatcher is a tool to check an input against a database of known variants.
For example, to determine (and resort to fuzzy-matching if required) whether
some unsanitized fields of user-input match a preset of known-good entries.
Author: Santiago Saavedra <info@ssaavedra.eu>
SPDX-License-Identifier: CC0-1.0
'''
@ssaavedra
ssaavedra / primevideospeedchanger.user.js
Last active April 9, 2020 01:59
PrimeVideo Speed Changer
// ==UserScript==
// @name PrimeVideo/Netflix Speed Changer
// @namespace http://ssaavedra.eu/
// @version 1.2.3
// @description ALlows changing the playback speed on Primevideo and Netflix
// @author ssaavedra
// @homepageURL https://gitlab.com/ssaavedra.eu/userscripts
// @downloadURL https://gitlab.com/ssaavedra.eu/userscripts/-/raw/master/primevideospeedchanger.user.js
// @updateURL https://gitlab.com/ssaavedra.eu/userscripts/-/raw/master/primevideospeedchanger.user.js
// @match https://www.primevideo.com/*
@ssaavedra
ssaavedra / realboot.xml
Last active April 17, 2019 14:01
Libvirt configuration to boot from a real harddrive with VGA Passthrough on 00:07.0 + 00:07.1 with audio attached to PulseAudio of user id 1000 and support for a PS/2 mouse shared with the host (Use Ctrl_L + Ctrl_R to switch). With looking-glass IVSHM configured (17M is enough for fullhd, but round to nearest power of 2).
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>win10</name>
<uuid>3716c67d-59b9-42f4-8ac4-f0ada39ef48a</uuid>
<memory unit='KiB'>16588800</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<memoryBacking>
<hugepages/>
</memoryBacking>
<vcpu placement='static'>8</vcpu>
<iothreads>2</iothreads>
@ssaavedra
ssaavedra / org-clock-back.el
Last active October 1, 2018 11:59
Convert orgmode clocktable time to numbers
;; Receive time as a string like "9d 11:28"
;; Outputs the number of minutes in that
;; The regex works with and without days.
;; MIT License
(defun my-minutes-in-org-time (time)
(let ((re "\\(\\([0-9]+\\)d \\)?\\([0-9]+\\):\\([0-9]+\\)")
(values '(2 3 4)))
(save-match-data
(catch 'exit
(if (not (string-match re time))
@ssaavedra
ssaavedra / pre-commit
Last active September 19, 2018 13:29
Setup a repo pre-commit hook to use scalafmt
#!/bin/sh
# Licensed under CC0 in jurisdictions where this is not directly in the Public Domain
# Authored by Santiago Saavedra (github.com/ssaavedra)
git scalafmt --test || exit 1
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Code that was considered unreachable by closed-world analysis was
reached
at java.lang.Throwable.<init>(Throwable.java:265)
at java.lang.Error.<init>(Error.java:70)
at com.oracle.svm.core.jdk.UnsupportedFeatureError.<init>(UnsupportedFeatureError.java:31)
at com.oracle.svm.core.jdk.Target_com_oracle_svm_core_util_VMError.unsupportedFeature(VMErrorSubstitutions.java:109)
at com.oracle.svm.core.snippets.SnippetRuntime.unreachedCode(SnippetRuntime.java:199)
at scala.collection.mutable.ResizableArray.swap$(ResizableArray.scala:111)
at scala.collection.mutable.PriorityQueue$ResizableArrayAccess.p_swap(PriorityQueue.scala:66)
at scala.collection.mutable.PriorityQueue.fixUp(PriorityQueue.scala:87)
@ssaavedra
ssaavedra / utils.sh
Created July 26, 2018 18:07
Get latest offset from a Kafka topic
get_latest_offset () {
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list "$KAFKA_BROKER_LIST" --topic "$1" |cut -d: -f3 | sort | head -1
}

Keybase proof

I hereby claim:

  • I am ssaavedra on github.
  • I am ssaavedra (https://keybase.io/ssaavedra) on keybase.
  • I have a public key whose fingerprint is 7346 F19D 9BB3 A08C 7532 E0E6 92CB A518 CBD9 18D9

To claim this, I am signing this object: