Skip to content

Instantly share code, notes, and snippets.

View pocmo's full-sized avatar
🚀
Just passing by.

Sebastian Kaspari pocmo

🚀
Just passing by.
View GitHub Profile
@pocmo
pocmo / generic_middleware.kt
Created January 4, 2022 17:01
Generic middleware
interface StateWithTopSites : State {
val topsites: List<TopSite>
}
interface TopSite {
// ..
}
interface AddTopSiteAction {
val topSite: TopSite
A Brainfuck interpreter (and never completed compiler)
written in C++ to play with the idea of optimization:
https://github.com/pocmo/Brainfuck.CPP
Using the Kotlin grammar docs to write a compiler for
a subset. Never completed parsing the whole AST though. :)
https://github.com/pocmo/tinyK
"Translator" for parsing Android View XML and translating
it to Jetpack Compose code:
| | | +--- androidx.lifecycle:lifecycle-runtime:2.0.0
| | | | +--- androidx.lifecycle:lifecycle-common:2.0.0
| | | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0
| | | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.0.0
| | | | | | | +--- androidx.lifecycle:lifecycle-common:2.0.0 (*)
| | | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0
| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 (*)
| | | | +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.3.1
| | | | | +--- androidx.lifecycle:lifecycle-common:2.3.1
| | | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 (*)
console.log("-----------------------------");
document.querySelectorAll('link[rel="icon"]').forEach(
function(currentValue, currentIndex, listObj) {
console.log("ICON (" + currentValue.sizes + "): " + currentValue.href)
})
document.querySelectorAll('link[rel="shortcut icon"]').forEach(
function(currentValue, currentIndex, listObj) {
console.log("SHORTCUT ICON (" + currentValue.sizes + "): " + currentValue.href)
@pocmo
pocmo / SearchSuggestionProvider.kt
Last active October 25, 2018 14:04
SuggestionProvider implementations
package mozilla.components.feature.awesomebar.provider
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.runBlocking
import mozilla.components.browser.search.SearchEngine
import mozilla.components.browser.search.suggestions.SearchSuggestionClient
import mozilla.components.concept.awesomebar.AwesomeBar
import mozilla.components.feature.search.SearchUseCases
import java.io.IOException
import java.net.HttpURLConnection

Architecture:

Session:

GeckoViewModule D dispatch GeckoView:SetFocused, data={"focused":false}
GeckoViewContent D onEvent: event=GeckoView:SetFocused, data={"focused":false}
EGL_emulation D eglMakeCurrent: 0xefa0c100: ver 3 0
D eglMakeCurrent: 0xefa0c100: ver 3 0
GeckoViewModule D dispatch GeckoView:LoadUri, data={"uri":"about:crashcontent","flags":0}
GeckoViewNavigation D onEvent: event=GeckoView:LoadUri, data={"uri":"about:crashcontent","flags":0}
Web Content I Utils: Failed to deserialize principal_b64 '[xpconnect wrapped (nsISupports, nsIPrincipal, nsISerializable)]' [Exception... "Component retu
rned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsISerializationHelper.deserializeObject]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL
_VALUE)" location: "JS frame :: resource://gre/modules/sessionstore/Utils.jsm :: deserializePrincipal :: line 137" data: no]
IInputConnectionWrapper W r
Caused by: com.android.tools.r8.utils.AbortException
at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:67)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:62)
... 10 more
Suppressed: com.android.tools.r8.ApiLevelException: Default interface methods are only supported starting with Android N (--min-api 24): com.google.android.exoplayer2.upstream.DataSource com.google.android.exoplayer2.upstream.HttpDataSource$Factory.createDataSource()
at com.android.tools.r8.dex.FileWriter.checkInterfaceMethod(FileWriter.java:247)
at com.android.tools.r8.dex.FileWriter.checkInterfaceMethods(FileWriter.java:213)
at com.android.tools.r8.dex.FileWriter.generate(FileWriter.java:140)
at com.android.tools.r8.dex.ApplicationWriter.writeDexFile(ApplicationWriter.java:356)
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package mozilla.components.service.fretboard.storage.flatfile
import android.util.AtomicFile
import mozilla.components.service.fretboard.ExperimentStorage
import mozilla.components.service.fretboard.ExperimentsSnapshot
import java.io.FileNotFoundException
  • service-fretboard: Experiments can now be filtered by release channel. Added helper method to get list of active experiments.
  • service-telemetry: Added option to report active experiments in the core ping.