Skip to content

Instantly share code, notes, and snippets.

View cketti's full-sized avatar

cketti cketti

View GitHub Profile
@cketti
cketti / github_never_unread.user.js
Last active June 12, 2021 16:59
No unread GitHub notifications
// ==UserScript==
// @name No unread GitHub notifications
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Hide GitHub's unread notification dot in the top bar
// @author cketti
// @match https://github.com/*
// @match https://gist.github.com/*
// @icon https://github.githubassets.com/favicons/favicon.svg
// @grant GM_addStyle
@cketti
cketti / instructions.md
Created May 27, 2021 16:57
matrix-docker-ansible-deploy + signald debugging
  • Clone signald fork used by matrix-docker-ansible-deploy: git clone https://mau.dev/maunium/signald.git
  • cd signald
  • Make changes to signald source code (add logging etc)
  • Build signald and create a docker image ready for use: docker build -t signald-debugging .
  • Edit /etc/systemd/system/matrix-mautrix-signal-daemon.service; replace dock.mau.dev/maunium/signald:latest with signald-debugging:latest
  • Make sure the modified service configuration is used: systemctl daemon-reload
  • Restart the signald docker container: systemctl restart matrix-mautrix-signal-daemon (this will use our signald-debugging image to create the container)
  • Hope the log contains the info you're looking for: journalctl -fu matrix-mautrix-signal-daemon
@cketti
cketti / youtube_preview.user.js
Created May 20, 2021 00:10
Element youtube preview fix (modified)
// ==UserScript==
// @name Element youtube preview
// @namespace http://tampermonkey.net/
// @version 0.3
// @description fix the embeds!!
// @author Cinnabar
// @author cketti
// @match https://app.element.io
// @match https://your.element.url.example
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
@cketti
cketti / jitsi-meet-apache.conf
Created January 27, 2021 11:49
Jitsi Meet startWithAudioMuted/startWithVideoMuted temporary fix
# …
# Allow access to /etc/jitsi/meet/start_muted.html
<Directory "/etc/jitsi/meet">
<FilesMatch "start_muted.html">
Require all granted
</FilesMatch>
</Directory>
RewriteEngine on
private void invalidateCursorPositionHack() {
int oldStart = getSelectionStart();
int oldEnd = getSelectionEnd();
// The selection values need to actually change in order for the cursor to be redrawn. If the cursor already
// is at position 0 this won't trigger a redraw. But that's fine because the size of our span can't influence
// cursor position 0.
setSelection(0);
setSelection(oldStart, oldEnd);
src/tck/
src/tck/java/
src/tck/java/time/
src/tck/java/time/format/
src/tck/java/time/format/TCKFormatStyle.java
src/tck/java/time/format/TCKOffsetPrinterParser.java
src/tck/java/time/format/TCKLocalizedFieldParser.java
src/tck/java/time/format/TCKDateTimeTextPrinting.java
src/tck/java/time/format/TCKTextStyle.java
src/tck/java/time/format/TCKDateTimeFormatter.java

Build "Sources for Android 29" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@cketti
cketti / ContentUriRequestBody.kt
Created March 27, 2019 14:59
Implementation of OkHttp's RequestBody that supports Android's content:// URIs
import android.content.ContentResolver
import android.net.Uri
import okhttp3.MediaType
import okhttp3.RequestBody
import okio.BufferedSink
import okio.Okio
import java.lang.IllegalStateException
class ContentUriRequestBody(
private val contentResolver: ContentResolver,
@cketti
cketti / android-28-sources.md
Created August 7, 2018 16:21
Build your own android-28 sources

Build "Sources for Android 28" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@cketti
cketti / android-27-sources.md
Created December 18, 2017 04:07
Build your own android-27 sources

Build "Sources for Android 27" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base