Skip to content

Instantly share code, notes, and snippets.

View kibotu's full-sized avatar
🎯
Focusing

Jan Rabe kibotu

🎯
Focusing
View GitHub Profile
@kibotu
kibotu / Playground.swift
Created April 8, 2024 07:49
testing iOS concurrency speed
import Foundation
class Queue {
private var counter = 0.0
private let queue = DispatchQueue(label: "counter")
func increment() {
queue.sync {
counter += 1.2
@kibotu
kibotu / adb_shell_inputs.sh
Created March 19, 2019 08:15
amazon-fire-tv-remote-input using adb
#!/usr/bin/env bash
# * https://developer.android.com/reference/android/view/KeyEvent#constants
# * https://developer.amazon.com/appsandservices/solutions/devices/fire-tv/docs/amazon-fire-tv-remote-input
# * ----------------------------------------------------------------------------------------------------
# * | | (KEYCODE_MEDIA_RECORD) | |
# * ----------------------------------------------------------------------------------------------------
# * | |
# * ----------------------------------------------------------------------------------------------------
# * | | KEYCODE_DPAD_UP | |
@kibotu
kibotu / Issues.md
Last active February 9, 2024 21:37
Ticket Templates

Bug Report Template

Help your QAs and the rest of your Agile Team members report bugs consistently! Use the bug report template for Jira issues and speed up the issue preparation process. This template ensures the reporter will provide enough information for the team to reproduce and fix the bug.


Provide a general summary of the issue in the Title above.

Expected Behaviour

@kibotu
kibotu / fcm_push.sh
Last active January 29, 2024 20:27
cURL pushes for firebase cloud messaging (fcm) and huawei cloud messaging (hcm)
#!/bin/sh
set -o errexit
set -o nounset
set -o xtrace
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
@kibotu
kibotu / extract_app_version.sh
Last active January 29, 2024 13:15
extract_app_version.sh
#!/bin/bash
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Check if -man option is passed
if [ -f "version-properties.gradle" ]; then
APP_VERSION_RAW=$(grep "appVersion *=" version-properties.gradle)
else
@kibotu
kibotu / CircularReveal.kt
Last active December 22, 2023 13:21 — forked from darvld/CircularReveal.kt
A circular reveal effect modifier for Jetpack Compose.
/**
* A modifier that clips the composable content using a circular reveal animation. The circle will
* expand or shrink whenever [isVisible] changes.
*
* For more control over the transition, consider using this method's variant which allows passing
* a [State] object to control the progress of the reveal animation.
*
* By default, the circle is centered in the content. However, custom positions can be specified using
@kibotu
kibotu / AppBarLayoutOverScrollViewBehavior.java
Last active November 15, 2023 07:59 — forked from zly394/AppBarLayoutOverScrollViewBehavior.java
Overscroll AppBarLayout Behavior—— AppBarLayout越界弹性效果
package com.zly.widget.behavior;
/**
* Created by zhuleiyue on 2017/3/7.
*/
class AppBarLayoutOverScrollViewBehavior(context: Context?, attrs: AttributeSet?) : AppBarLayout.Behavior(context, attrs) {
private var targetHeight = 500f
@kibotu
kibotu / ViewExtensions.kt
Last active September 13, 2023 05:45
Kotlin extension method to set margin.
fun View.setMargins(
left: Int? = null,
top: Int? = null,
right: Int? = null,
bottom: Int? = null
) {
val lp = layoutParams as? ViewGroup.MarginLayoutParams
?: return
lp.setMargins(
@kibotu
kibotu / UnityGetNativeAndroidVersion
Last active September 6, 2023 16:27
Get versionCode and versionName with unity.
//int vesioncode = context().getPackageManager().getPackageInfo(context().getPackageName(), 0).versionCode;
public static int GetVersionCode() {
AndroidJavaClass contextCls = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject context = contextCls.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject packageMngr = context.Call<AndroidJavaObject>("getPackageManager");
string packageName = context.Call<string>("getPackageName");
AndroidJavaObject packageInfo = packageMngr.Call<AndroidJavaObject>("getPackageInfo", packageName, 0);
return packageInfo.Get<int>("versionCode");
}
@kibotu
kibotu / build-ios-project-set-marketing-version.sh
Created July 3, 2023 07:24
Build iOS Project on command line. Set MARKETING_VERSION and CURRENT_PROJECT_VERSION.
#!/bin/bash
# https://stackoverflow.com/a/76070326/1006741
# Set the version and build numbers
VERSION_NUMBER="2.1.0"
BUILD_NUMBER="29"
APP_NAME="MyApp"
TEAM_ID="ABCDEFGH"