Skip to content

Instantly share code, notes, and snippets.

View valerauko's full-sized avatar
🦊
Very fox

valerauko

🦊
Very fox
View GitHub Profile
@valerauko
valerauko / flutter.log
Created August 4, 2023 09:37
java.lang.IllegalStateException: Reply already submitted
E/MethodChannel#flutter_tts(28553): Failed to handle method call
E/MethodChannel#flutter_tts(28553): java.lang.IllegalStateException: Reply already submitted
E/MethodChannel#flutter_tts(28553): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
E/MethodChannel#flutter_tts(28553): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:263)
E/MethodChannel#flutter_tts(28553): at com.tundralabs.fluttertts.FlutterTtsPlugin.onMethodCall(FlutterTtsPlugin.kt:326)
E/MethodChannel#flutter_tts(28553): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#flutter_tts(28553): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#flutter_tts(28553): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#flutter_tts(2
@valerauko
valerauko / smart_map.clj
Created November 6, 2022 07:19
Map declaration that treats solitary symbols specially
(defmacro ... [& input]
(loop [aggr {}
items input]
(if (empty? items)
aggr
(let [head (first items)
tail (rest items)]
(if (symbol? head)
(recur (assoc aggr (keyword head) head) tail)
(recur (assoc aggr head (first tail)) (rest tail)))))))
@valerauko
valerauko / playground.clj
Last active November 1, 2022 14:13
The kind of syntax I'd love to see for ClojureDart + Flutter
(ns flutter.playground
(:require [flutter.core :as f :refer [dispatch subscribe]]
[flutter.material :as m]))
(f/reg-event-fx
::to-counter
(fn [_ _]
{::f/navigator.pop []
::f/navigator.push-named [::counter]}))
@valerauko
valerauko / nanosquid.clj
Created November 21, 2020 06:07
Nano squids
;; for comparison, have the squid generator from the clojure cookbook that uses seconds
;; from https://github.com/clojure-cookbook/clojure-cookbook/blob/master/01_primitive-data/1-24_uuids.asciidoc
(defn squuid-secs []
(let [uuid (java.util.UUID/randomUUID)
time (System/currentTimeMillis)
secs (quot time 1000)
lsb (.getLeastSignificantBits uuid)
msb (.getMostSignificantBits uuid)
timed-msb (bit-or (bit-shift-left secs 32)
(bit-and 0x00000000ffffffff msb))]
@valerauko
valerauko / ps1.sh
Last active February 3, 2020 08:51
PS1
branch_color() {
branch=`git rev-parse --abbrev-ref HEAD 2> /dev/null`
[[ ! -z "$branch" ]] && [[ ! -z $(git status --porcelain 2> /dev/null) ]] && printf '\e[49;93m' || printf '\e[1;90m'
}
branch_print() {
branch=`git rev-parse --abbrev-ref HEAD 2> /dev/null`
[[ ! -z "$branch" ]] && printf " ($branch)"
}
@valerauko
valerauko / success_rate.yaml
Created December 14, 2019 14:49
Argo Rollouts success rate check with traefik
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
args:
- name: backend
metrics:
- name: success-rate
interval: 10s
@valerauko
valerauko / values.yaml
Created November 23, 2019 08:59
Telegraf Helm values to use with InfluxDB Cloud
replicaCount: 1
image:
repo: "telegraf"
tag: "1.12-alpine"
pullPolicy: IfNotPresent
podAnnotations: {}
imagePullSecrets: []
@valerauko
valerauko / sicp232.clj
Created August 16, 2019 14:41
Clojure implementation of the primitive deriver from SICP 2.3.2
(defn sum? [exp]
(= (first exp) '+))
(defn product? [exp]
(= (first exp) '*))
(defn pred* [exp clauses]
(when clauses
(list 'if (list (first clauses) exp)
(second clauses)
kind: Project
name: paca
environments:
- name: remote
providers:
- name: kubernetes
context: gke-kubernetes-context
defaultHostname: paca.example.com
forceSsl: true
tlsCertificates:
@valerauko
valerauko / filebeat.yml
Created December 16, 2018 11:27
Kitsune API server filebeat.yml
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# For more available modules and options, please see the filebeat.reference.yml sample