Skip to content

Instantly share code, notes, and snippets.

Avatar

cketti cketti

View GitHub Profile
@cketti
cketti / jitsi-meet-apache.conf
Created Jan 27, 2021
Jitsi Meet startWithAudioMuted/startWithVideoMuted temporary fix
View jitsi-meet-apache.conf
# …
# Allow access to /etc/jitsi/meet/start_muted.html
<Directory "/etc/jitsi/meet">
<FilesMatch "start_muted.html">
Require all granted
</FilesMatch>
</Directory>
RewriteEngine on
View InvalidateCursorPositionHack.java
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);
View files_removed_from_zip.txt
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
View android-29-sources.md

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 Mar 27, 2019
Implementation of OkHttp's RequestBody that supports Android's content:// URIs
View ContentUriRequestBody.kt
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 Aug 7, 2018
Build your own android-28 sources
View android-28-sources.md

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 Dec 18, 2017
Build your own android-27 sources
View android-27-sources.md

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
@cketti
cketti / android-26-sources.md
Last active Aug 14, 2019
Build your own android-26 sources
View android-26-sources.md

If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:

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

mkdir -p frameworks/base
@cketti
cketti / AndroidManifest.xml
Last active Jul 4, 2016
Android manifest entry for CopyToClipboardActivity with icon, label, and transparent theme
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...">
<application ...>
...
<activity
android:name=".CopyToClipboardActivity"
android:exported="false"
android:icon="@mipmap/ic_copy_link"
@cketti
cketti / CopyToClipboardActivity.java
Last active Jun 13, 2016
Activity that copies the URL from the Intent to the clipboard
View CopyToClipboardActivity.java
public class CopyToClipboardActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri uri = getIntent().getData();
if (uri != null) {
copyTextToClipboard(uri.toString());
Toast.makeText(this, "Link copied to clipboard", Toast.LENGTH_SHORT).show();