Skip to content

Instantly share code, notes, and snippets.

View ugommirikwe's full-sized avatar

Ugo ugommirikwe

View GitHub Profile
@ugommirikwe
ugommirikwe / ios_spinner_avd.xml
Created April 28, 2023 12:11 — forked from DarkionAvey/ios_spinner_avd.xml
iOS-like spinner as an animated vector drawable for Android without the need of custom classes, or worse, gifs. Use support library to get it to work on older devices. To change color, simply change fillColor but not the alpha. You have to register a callback to make it repeat, because android doesn't allow animationset to repeat
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
android:name="vector"
android:width="20dp"
android:height="20dp"
android:viewportWidth="60"
android:viewportHeight="60">
<path
#Ruby version
ruby_version("3.0.2")
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
fastlane_require 'dotenv'
default_platform(:ios)
fastlane_require 'dotenv'
default_platform(:android)
platform :android do
# Have an easy way to get the root of the project
def root_path
Dir.pwd.sub(/.*\Kfastlane/, '').sub(/.*\Kandroid/, '').sub(/.*\Kios/, '').sub(/.*\K\/\//, '')
end
@ugommirikwe
ugommirikwe / CoroutineTestRule.kt
Created April 24, 2020 13:12 — forked from AniketSK/CoroutineTestRule.kt
A test rule to allow testing coroutines that use the main dispatcher. Without this you'd run into "java.lang.IllegalStateException: Module with the Main dispatcher had failed to initialize. For tests Dispatchers.setMain from kotlinx-coroutines-test module can be used"
package com.aniketkadam.sharevideoshortcut
import org.junit.rules.TestWatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
import org.junit.runner.Description
@ugommirikwe
ugommirikwe / ios_android.dart
Created August 8, 2019 14:01 — forked from slightfoot/ios_android.dart
Example of using defaultTargetPlatform to change the entire widget tree based on platform.
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
//runApp(IOSApp());
//runApp(AndroidApp());
runApp(defaultTargetPlatform == TargetPlatform.iOS ? IOSApp() : AndroidApp());
}
@ugommirikwe
ugommirikwe / querystring.swift
Created February 27, 2019 08:34 — forked from gillesdemey/querystring.swift
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
@ugommirikwe
ugommirikwe / ApiService.java
Created September 29, 2015 08:33 — forked from dustin-graham/ApiService.java
Infinite Scrolling Android RecyclerView with RxJava
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) {
return Observable.create(new Observable.OnSubscribe<List<String>>() {
@Override
public void call(final Subscriber<? super List<String>> subscriber) {
onNextObservable.subscribe(new Observer<Void>() {
int latestPage = -1;
@Override
public void onCompleted() {
subscriber.onCompleted();
@ugommirikwe
ugommirikwe / res_color_btn_flat_selector.xml
Last active August 29, 2015 14:22 — forked from dmytrodanylyk/res_color_btn_flat_selector.xml
Android Material (Flat) Button style themeing code snippets
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:color="@color/flat_disabled_text"/>
<item android:color="@color/flat_normal_text"/>
</selector>
@ugommirikwe
ugommirikwe / mixin-rgba.less
Last active August 29, 2015 14:21 — forked from anonymous/gist:4169726
CSS LESS Mixin for applying background color using the RGBA expression.
.rgba(@colour, @alpha) {
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha);
@ieAlphaColour: argb(@alphaColour);
background-color: @colour; // Fallback for older browsers
// IE hacks
zoom: 1; // hasLayout
background-color: transparent\9;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=@{ieAlphaColour}, endColorstr=@{ieAlphaColour})"; // IE 8+