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 / 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 / .bash_profile
Created June 16, 2023 17:43 — forked from hakusaro/.bash_profile
My Raspberry Pi's .bash_profile. Differences from original are purely aesthetic - no need for weather, and I like things to be lined up nicely when I ssh into my RPi.
#!/bin/bash
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages
read one five fifteen rest < /proc/loadavg
import android.graphics.Canvas
import android.graphics.Rect
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
/**
* Created with Android Studio
* User: Sergey Petrov s.a.petrov.spb@gmail.com
@kibotu
kibotu / ParallaxScreen.kt
Created June 1, 2022 08:41 — forked from surajsau/ParallaxScreen.kt
Parallax effect with Jetpack Compose
@Composable
fun ParallaxScreen(modifier: Modifier = Modifier) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
var data by remember { mutableStateOf<SensorData?>(null) }
DisposableEffect(Unit) {
val dataManager = SensorDataManager(context)
dataManager.init()
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@kibotu
kibotu / FragmentArgumentDelegate.kt
Last active May 13, 2021 14:22 — forked from yanngx/FragmentArgumentDelegate.kt
Fragment arguments without hassle !
package tv.freenet.selfcare.extensions
import android.os.Binder
import android.os.Bundle
import android.os.Parcelable
import androidx.core.app.BundleCompat
import androidx.fragment.app.Fragment
import org.parceler.ParcelWrapper
import org.parceler.Parcels
/*
* OpenSimplex (Simplectic) Noise in Java.
* (v1.0.1 With new gradient set and corresponding normalization factor, 9/19/14)
*/
public class OpenSimplexNoise {
private static final double STRETCH_CONSTANT_3D = -1.0 / 6;
private static final double SQUISH_CONSTANT_3D = 1.0 / 3;
@kibotu
kibotu / BaseUpdateCheckActivity.kt
Created November 15, 2020 13:57 — forked from saikiran91/BaseUpdateCheckActivity.kt
Android officially announced the in-app updates. https://developer.android.com/guide/app-bundle/in-app-updates. This is the code sample for handling both IMMEDIATE and FLEXIBLE updates in a single activity; Kotlin way.
import android.app.Activity
import android.content.Intent
import android.content.IntentSender
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.google.android.material.snackbar.Snackbar
import com.google.android.play.core.appupdate.AppUpdateManager
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
@kibotu
kibotu / ffmpeg_flags.txt
Last active September 24, 2020 06:42 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)