Skip to content

Instantly share code, notes, and snippets.

Avatar

Santiago Saavedra ssaavedra

View GitHub Profile
View primevideospeedchanger.user.js
// ==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 Apr 17, 2019
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).
View realboot.xml
<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 / pre-commit
Last active Sep 19, 2018
Setup a repo pre-commit hook to use scalafmt
View pre-commit
#!/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 --
View scalafmt-graalvm.stacktrace
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 Jul 26, 2018
Get latest offset from a Kafka topic
View utils.sh
get_latest_offset () {
kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list "$KAFKA_BROKER_LIST" --topic "$1" |cut -d: -f3 | sort | head -1
}
View keybase.md

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:

@ssaavedra
ssaavedra / fix-vodafone-router.user.js
Last active Mar 19, 2018
Fix Vodafone's router UI to be able to auto-fill the user/password again
View fix-vodafone-router.user.js
// ==UserScript==
// @name Fix dumb "new" Vodafone router page
// @namespace http://192.168.1.1//
// @include /http:\/\/(192\.168|10\.(\d{1,3})|172\.(\d+))\.(\d+).1\/login.html/
// @license https://opensource.org/licenses/MIT
// @grant none
// ==/UserScript==
// Uses a regex so that your router can be configured on any local IP.
@ssaavedra
ssaavedra / create-aws-repo.sh
Created May 10, 2017
Create an AWS ECR repository and add a policy to it from an already existing repo.
View create-aws-repo.sh
#!/bin/bash
# Author: Santiago Saavedra
# License: CC0
# Usage: $0 --help
POLICY_REPOSITORY=${AWS_DEFAULT_ECR_POLICY_REPOSITORY:-policy-repo}
usage () {
cat <<-EOF | awk 'NR==1 && match($0, /^ +/){n=RLENGTH} {print substr($0, n+1)}'
Usage: $0 <aws-repository-name>
@ssaavedra
ssaavedra / using-emacs-to-write-clir-files.md
Last active Nov 18, 2016
How to use Emacs to write CLIR files
View using-emacs-to-write-clir-files.md

This is a Beginners Guide to writing CAVI-ART's CLIR files using Emacs, for people who has never used Emacs.

Introduction to Emacs

Emacs is a editor very leaned to using the keyboard as the primary input method. Thus, most commands on Emacs can be entered through the keyboard, although most can also be entered through the toolbar with the mouse.

@ssaavedra
ssaavedra / operator.hs
Created Nov 7, 2016
Haskell and higher-order polymorphism. Intuitionstic logic and type theory.
View operator.hs
{-# LANGUAGE RankNTypes #-}
module Operator
where
(***) f g (x1, x2) = (f x1, g x2)
f :: [a] -> [a]
f = snd . splitAt 1
type GType a = ([a], [a])
You can’t perform that action at this time.