Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Jan Rabe kibotu

:octocat:
Focusing
Block or report user

Report or block kibotu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kibotu
kibotu / AppBarLayoutOverScrollViewBehavior.java
Last active Jun 26, 2019 — forked from zly394/AppBarLayoutOverScrollViewBehavior.java
Overscroll AppBarLayout Behavior—— AppBarLayout越界弹性效果
View AppBarLayoutOverScrollViewBehavior.java
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 / DataSource.kt
Created Jun 13, 2019
Generic Repository Interface
View DataSource.kt
/**
* Default interface for DAOs.
*/
interface DataSource<T> {
fun all(): List<T>
fun readById(id: String): T
@kibotu
kibotu / Repository.kt
Created Jun 13, 2019
Generic Repository Interface
View Repository.kt
import androidx.lifecycle.LiveData
/**
* Generic interface for working with [T]
*/
interface Repository<T> {
/**
* Gets all [T].
@kibotu
kibotu / extract_realm_database_android.sh
Created Jun 11, 2019 — forked from jk2K/extract_realm_database_android.sh
how to export realm database, work on Android 5.0+
View extract_realm_database_android.sh
#!/bin/bash
ADB_PATH="/Users/lee/Library/Android/sdk/platform-tools"
PACKAGE_NAME="com.yourcompany.app"
DB_NAME="default.realm"
DESTINATION_PATH="/Users/lee/Downloads/${DB_NAME}"
NOT_PRESENT="List of devices attached"
ADB_FOUND=`${ADB_PATH}/adb devices | tail -2 | head -1 | cut -f 1 | sed 's/ *$//g'`
if [[ ${ADB_FOUND} == ${NOT_PRESENT} ]]; then
echo "Make sure a device is connected"
else
View bg_save_gradient.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="@color/bg_save_bottom_gradient"
android:startColor="@color/bg_save_top_gradient" />
</shape>
View gist:27c5d665d19b9f782e6b4f26eff878b1
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)
@kibotu
kibotu / DeviceOrientation
Created Apr 23, 2019 — forked from Abdelhady/DeviceOrientation
A utility class to help get current device orientation, you will need it if you decided to fix the activity's orientation in the manifest :)
View DeviceOrientation
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.media.ExifInterface;
/**
* Created by abdelhady on 9/23/14.
*
* to use this class do the following 3 steps in your activity:
@kibotu
kibotu / IRepository.cs
Created Mar 21, 2019
Simple Repository
View IRepository.cs
using System;
using System.Collections.Generic;
using System.Linq;
public interface IRepository<T>
{
T Create();
void Add(T item);
@kibotu
kibotu / PageBaseFragment.kt
Created Mar 21, 2019
Visibility hint on viewpager
View PageBaseFragment.kt
import android.os.Bundle
import com.exozet.android.core.extensions.logv
import net.kibotu.swipedirectionviewpager.SwipeDirection
import net.kibotu.swipedirectionviewpager.ViewPagerPresenterAdapter
abstract class PageBaseFragment : BaseFragment(), ViewPagerPresenterAdapter.ViewPagerPresenter<Any, Any> {
// region ViewPagerPresenterAdapter.ViewPagerPresenter
override var viewPagerPresenterAdapter: ViewPagerPresenterAdapter<Any, Any>? = null
@kibotu
kibotu / adb_register.sh
Last active Mar 20, 2019
adb shell register
View adb_register.sh
#!/usr/bin/env bash
# https://developer.android.com/reference/android/view/KeyEvent#constants
adb shell input text "lorem10@ipsum.net"
adb shell input keyevent 66 # 66 = KEYCODE_ENTER
adb shell input text "lorem10@ipsum.net"
adb shell input keyevent 66
adb shell input text "123456789"
adb shell input text "pwd"
You can’t perform that action at this time.