Skip to content

Instantly share code, notes, and snippets.


Jacek Marchwicki jacek-marchwicki

View GitHub Profile
#!/bin/bash -e
echo "WARNING"
echo "All docker files that are currenlty not runned will be removed!"
echo "Press enter to continue, or ctrl+c"
echo "Removing stopped images"
docker ps -a -q -f status=exited | xargs --no-run-if-empty docker rm || echo "Oooopps..."
View Using schedulers while testing your

Using schedulers while testing your code

Let's start with some example

We would like to implement UI that will send some post to API. Our UI will need a button that will send a post, and a text field called "message" so a user will be able to choose a message that will be posted to the server. Of course, our UI can display errors and will show success (via toast). We will implement everything via MVC and will test presenter.

At a starting point we will have two classes that will be returned from API:

  • ApiError - it's used to represent some errors from API,
  • Post that represent post that needs to be added to the server.
jacek-marchwicki /
Created Mar 25, 2015
LastCall mockito verification
* Copyright 2015 Jacek Marchwicki <>
* 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
View designer.html
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
:host {
position: absolute;
jacek-marchwicki /
Created Jun 18, 2014
ViewPager with getActiveFragment for position
package com.yapert.view.viewpager;
import android.content.Context;
import android.util.AttributeSet;
View gist:5346268
// Add this template in Preferences > Java > Editor > Templates > New
// I stored this snippet with newLoader name, but you can use any name you want
// To use this loader your class should implements LoaderCallbacks<Cursor>
private static final int ${loaderName} = 0;
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
switch (id) {
case ${loaderName}:
View gist:5344188
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
return false;
return true;
View git-completion.bash
# bash/zsh completion support for core Git.
# Copyright (C) 2006,2007 Shawn O. Pearce <>
# Conceptually based on gitcompletion (
# Distributed under the GNU General Public License, version 2.0.
# The contained completion routines provide support for completing: