Skip to content

Instantly share code, notes, and snippets.

View atsushieno's full-sized avatar

Atsushi Eno atsushieno

View GitHub Profile
@atsushieno
atsushieno / ZipArchivePathHandler.kt
Last active June 29, 2021 09:56
WebView Asset PathHandler that returns contents of a zip archive.
// Licensed under CC-0 terms. https://creativecommons.org/share-your-work/public-domain/cc0/
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
import java.util.zip.ZipInputStream
import android.webkit.WebResourceResponse
import androidx.webkit.WebViewAssetLoader
// WebView Asset PathHandler that returns contents of a zip archive.
@atsushieno
atsushieno / flatten-sfz.js
Created March 6, 2020 08:19
flatten-sfz.js - resolve #include paths in .sfz and make sfz files loadable on SFZ tools that do not support ARIA extensions.
const fs = require('fs');
const path = require('path');
main();
function main() {
var args = process.argv.slice(2);
var sfzDirPath = args.length == 0 ? process.cwd() : args[0];
~/Desktop/libpng12$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
transfig : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
~/Desktop/libpng12$ sudo apt --fix-broken install
Reading package lists... Done
Privacy Badger (www.eff.org/privacybadger) is a browser extension that automatically learns to block invisible trackers. Privacy Badger is made by the Electronic Frontier Foundation, a nonprofit that fights for your rights online.
Privacy Badger found 19 potential trackers on atsushieno.hatenablog.com:
ad.as.amanad.adtdp.com
c.amazon-adsystem.com
bidder.criteo.com
www.google.com
b.hatena.ne.jp
blog.hatena.ne.jp
@atsushieno
atsushieno / gist:3e3ae7efe29fadea6d1a6edd3fe3479c
Created May 27, 2019 15:14
grep -nR "import java\\." | grep -v test | grep -v androidTest | grep -v buildSrc | grep -v android-studio-ide | grep "import java."
/sources/android/frameworks/support/ui$ grep -nR "import java\\." | grep -v test | grep -v androidTest | grep -v buildSrc | grep -v android-studio-ide | grep "import java."
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:47:import java.io.IOException
framework/src/main/java/androidx/ui/core/TextSpanCompose.kt:28:import java.util.WeakHashMap
text/src/main/java/androidx/ui/engine/text/ParagraphBuilder.kt:18:import java.util.LinkedList
text/src/main/java/androidx/ui/engine/text/ParagraphBuilder.kt:19:import java.util.Stack
text/src/main/java/androidx/ui/engine/text/platform/ParagraphAndroid.kt:71:import java.util.Locale
demos/src/main/java/androidx/ui/demos/MainActivity.kt:25:import java.text.Collator
demos/src/main/java/androidx/ui/demos/MainActivity.kt:26:import java.util.ArrayList
demos/src/main/java/androidx/ui/demos/MainActivity.kt:27:import java.util.Comparator
demos/src/main/java/androidx/ui/demos/MainActivity.kt:28:import java.util.HashMap
@atsushieno
atsushieno / gist:f73a31eb84dd727a46171d65fd50cfd1
Created May 27, 2019 15:11
grep -nR "import android\\." | grep -v test | grep -v androidTest | grep -v android-studio-ide | grep -v android-view-non-ir | grep "import android."
/sources/android/frameworks/support/ui$ grep -nR "import android\\." | grep -v test | grep -v androidTest | grep -v android-studio-ide | grep -v android-view-non-ir | grep "import android."
framework/src/main/java/androidx/ui/core/Text.kt:18:import android.content.Context
framework/src/main/java/androidx/ui/core/vectorgraphics/PathParser.kt:19:import android.util.Log
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:19:import android.annotation.SuppressLint
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:20:import android.content.res.Resources
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:21:import android.content.res.TypedArray
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:22:import android.util.AttributeSet
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/VectorResource.kt:23:import android.util.Log
framework/src/main/java/androidx/ui/core/vectorgraphics/compat/
@atsushieno
atsushieno / gist:429ed6088bec0eb5eb70c2351fe012fe
Created May 22, 2019 14:04
validating LV2 plugins from ubuntu package using lv2_validate (which does not exist in the ubuntu package, seems like new in master)
/sources/LV2/lilv$ LV2_PATH=../dist/lib/lv2 LD_LIBRARY_PATH=../dist/lib/:$LD_LIBRARY_PATH PATH=../dist/bin/:$PATH ../dist/bin/lv2_validate /usr/lib/lv2/ZamDelay.lv2/manifest.ttl
error: Literal `1.0' datatype <http://www.w3.org/2001/XMLSchema#decimal> is not compatible with <http://lv2plug.in/ns/ext/atom#Float>
b352
http://lv2plug.in/ns/ext/parameters#gain
1.0
error: Object not in range <http://lv2plug.in/ns/ext/atom#Float>
b352
http://lv2plug.in/ns/ext/parameters#gain
@atsushieno
atsushieno / lilv-sharp.cs
Created May 9, 2019 18:42
mono --debug $(NCLANG)/samples/PInvokeGenerator/bin/Debug/net462/PInvokeGenerator.exe --lib:lilv --ns:LilvSharp /usr/include/lilv-0/lilv/lilv.h --match:lv2 --match:lilv --arg:"-Duint32_t=unsigned int" --arg:"-DLV2_URID=unsigned int" > lilv-interop.cs
// This source file is generated by nclang PInvokeGenerator.
using System;
using System.Runtime.InteropServices;
using time_t = System.IntPtr;
using size_t = System.IntPtr;
using LV2_Handle = System.IntPtr;
using delegate5 = LilvSharp.Delegates.LV2_Descriptor_Function; // lv2.h (394,3)
using LV2_Lib_Handle = System.IntPtr;
using delegate8 = LilvSharp.Delegates.LV2_Lib_Descriptor_Function; // lv2.h (463,3)
using LV2_URID_Map_Handle = System.IntPtr;
@atsushieno
atsushieno / Dockerfile
Created April 28, 2019 07:12
fluidsynth for Android docker build
FROM bitriseio/android-ndk
WORKDIR /usr/local/src
ENV ANDROID_NDK_PATH /opt/android-ndk
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user