Skip to content

Instantly share code, notes, and snippets.

Avatar

Riccardo Ciovati rciovati

View GitHub Profile
@bmc08gt
bmc08gt / SwipeToDelete.kt
Last active Jan 24, 2023
Jetpack Compose Modifier extension to implement swipe-to-delete via Modifier.draggable
View SwipeToDelete.kt
import androidx.animation.IntToVectorConverter
import androidx.animation.tween
import androidx.compose.Composable
import androidx.compose.mutableStateOf
import androidx.compose.remember
import androidx.ui.animation.animatedFloat
import androidx.ui.animation.animatedValue
import androidx.ui.core.*
import androidx.ui.core.gesture.scrollorientationlocking.Orientation
import androidx.ui.foundation.animation.FlingConfig
View coroutines.md
@omnisis
omnisis / nexus-uploader.py
Last active Dec 8, 2022
Uploads a local M2 repo to a remote Nexus Server
View nexus-uploader.py
#!/usr/bin/env python
""""
nexus-uploader.py
Allows mirroring local M2 repositories to a remote Nexus server with a single command.
Supports:
- uploading of common classifiers (sources, javadocs) if available
- using regex include pattern for artifactIds/groupIds
- recursively processing local repo, just point to the root
@omarmiatello
omarmiatello / RxUtils.kt
Created Jul 27, 2015
Helper class for handle rx.Subscription in Activity/Fragment
View RxUtils.kt
package it.justonetouch.utils
import rx.Observable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import rx.subscriptions.CompositeSubscription
import kotlin.properties.Delegates
/**
@rock3r
rock3r / giffify.py
Last active Jan 14, 2022
Giffify - easily create optimised GIFs from a video
View giffify.py
#!/usr/bin/python
# License for any modification to the original (linked below):
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you can buy us a beer in return.
import argparse, sys, subprocess, tempfile
@vgonda
vgonda / MainActivityTest.java
Created Jun 11, 2015
Example of how to use espresso-intents in Android tests
View MainActivityTest.java
package com.collectiveidea.example;
import android.content.Intent;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.collectiveidea.example.ui.LoginActivity;
import com.collectiveidea.example.ui.MainActivity;
import com.collectiveidea.example.util.AccountUtility;
@iPaulPro
iPaulPro / include_list_viewpager.xml
Last active Aug 12, 2022
CollapsingToolbarLayout with TabLayout
View include_list_viewpager.xml
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (C) 2015 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
@pyricau
pyricau / OomExceptionHandler.java
Created May 6, 2015
Dump the heap on OutOfMemoryError crashes in your debug builds.
View OomExceptionHandler.java
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();
@danawoodman
danawoodman / 0-react-hello-world.md
Last active May 23, 2022
React Hello World Examples
View 0-react-hello-world.md

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

View CollapsingTitleLayout.java
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software