Skip to content

Instantly share code, notes, and snippets.

View ssmiech's full-sized avatar

Slawomir Smiechura ssmiech

View GitHub Profile
@ssmiech
ssmiech / dumpRunningThreads.java
Created January 17, 2018 15:21
If I ever need to figure out which threads are running when testing with Espresso
private void dumpThreads() {
int activeCount = Thread.activeCount();
Thread[] threads = new Thread[activeCount];
Thread.enumerate(threads);
for (Thread thread : threads) {
System.err.println(thread.getName() + ": " + thread.getState());
for (StackTraceElement stackTraceElement : thread.getStackTrace()) {
System.err.println("\t" + stackTraceElement);
}
}
@ssmiech
ssmiech / dumpRunningThreads.java
Created January 17, 2018 15:21
If I ever need to figure out which threads are running when testing with Espresso
private void dumpThreads() {
int activeCount = Thread.activeCount();
Thread[] threads = new Thread[activeCount];
Thread.enumerate(threads);
for (Thread thread : threads) {
System.err.println(thread.getName() + ": " + thread.getState());
for (StackTraceElement stackTraceElement : thread.getStackTrace()) {
System.err.println("\t" + stackTraceElement);
}
}
@ssmiech
ssmiech / GIF-Screencast-OSX.md
Created October 14, 2016 18:34 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ssmiech
ssmiech / Readme.md
Created June 10, 2016 18:53 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@ssmiech
ssmiech / include_list_viewpager.xml
Created May 27, 2016 20:10 — forked from iPaulPro/include_list_viewpager.xml
CollapsingToolbarLayout with TabLayout
<?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
@ssmiech
ssmiech / GridInsetDecoration.java
Created April 8, 2016 14:32 — forked from UweTrottmann/GridInsetDecoration.java
RecyclerView grid spacing decoration for use with GridLayoutManager.
/*
* Copyright 2015 Uwe Trottmann
*
* 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
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
require 'RMagick'
module WGif
class GifMaker
def make_gif(frames_dir, filename, dimensions)
image = Magick::ImageList.new(*frames_dir)
resize(image, dimensions)
image.coalesce
image.optimize_layers Magick::OptimizeLayer
image.write(filename)
@ssmiech
ssmiech / invisibleText.java
Last active August 29, 2015 13:57
How to read text from hidden divs
package selenium;
import java.sql.Driver;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Wait;
@ssmiech
ssmiech / table.html
Created February 6, 2014 15:43
Clicking <table> column based on another columnt
<table>
<tr>
<th>Name</th>
<th>Mobile</th>
<th>No Introducer</th>
<th>Created On</th>
<th>Status</th>
<th>Action</th>
</tr>