Skip to content

Instantly share code, notes, and snippets.

Bartosz Kosarzycki kosiara

Block or report user

Report or block kosiara

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
justasm / app_build.gradle
Created Mar 9, 2017
Kotlin Android Extensions with Android library module
View app_build.gradle
apply plugin: ''
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.kxt"
minSdkVersion 15
private static class ImmediateSchedulersRule implements TestRule {
public Statement apply(final Statement base, Description description) {
return new Statement() {
public void evaluate() throws Throwable {
RxJavaPlugins.setIoSchedulerHandler(scheduler ->
RxJavaPlugins.setComputationSchedulerHandler(scheduler ->
JakeWharton /
Last active Mar 15, 2019
A comparison between non-capturing and capturing expressions across Java 6, Java 8, Java 8 with Retrolambda, Kotlin with native function expressions, and Kotlin with Java SAM expression.
import java.util.Arrays;
class NonCapturing {
public static void main(String... args) {
run(new Runnable() {
@Override public void run() {
mSobhy90 /
Last active Mar 11, 2017
An example of how-to implement an infinite scrolling adapter for a RecyclerView, with a ProgressBar footer. Blog post can be found here:
package net.sarmady.contactcarswithtabs.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
edorgeville /
Last active May 1, 2019
Creates a signed and zipaligned APK from your Ionic project
# Creates a signed and zipaligned APK from your Ionic project
# Place your keystore in the root of your project and name it <company>.keystore
# Use this script as following :
# $ ./ [company] [version]
# Don't forget to gitignore your key and your compiled apks.
View ButterKnife.kt
public abstract class ButterKnifeViewHolder(val itemView : View) {}
public fun <T : View> ButterKnifeViewHolder.bindView(id: Int): ReadOnlyProperty<Any, T> = ViewBinding(id)
public fun <T : View> ButterKnifeViewHolder.bindOptionalView(id: Int): ReadOnlyProperty<Any, T?> = OptionalViewBinding(id)
public fun <T : View> ButterKnifeViewHolder.bindViews(vararg ids: Int): ReadOnlyProperty<Any, List<T>> = ViewListBinding(ids)
public fun <T : View> ButterKnifeViewHolder.bindOptionalViews(vararg ids: Int): ReadOnlyProperty<Any, List<T>> = OptionalViewListBinding(ids)
franmontiel /
Last active Sep 26, 2019
A persistent CookieStore implementation for use in Android with HTTPUrlConnection or OkHttp 2. -- For a OkHttp 3 persistent CookieJar implementation you can use this library:
* Copyright (c) 2015 Fran Montiel
* 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
* Unless required by applicable law or agreed to in writing, software
ChuckJHardy /
Created Mar 19, 2014
Android MainActivityTest Example
import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.test.ViewAsserts;
import android.view.View;
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> {
sgergely / gist:3793166
Created Sep 27, 2012
Midnight Commander Keyboard Shortcuts for Mac OSX
View gist:3793166
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
Abizern /
Created Mar 6, 2011
Skeleton Python3 file template
#!/usr/bin/env python3 -tt
Module documentation.
# Imports
import sys
#import os
# Global variables
You can’t perform that action at this time.