Skip to content

Instantly share code, notes, and snippets.

ssp /
Last active Nov 1, 2016
Script to clone and build gitx
#!/usr/bin/env sh
# Script to clone gitx from github and build it using
# the scripts provided by the project.
# Sven-S. Porst @ssp <>
git clone
cd gitx
vganin /
Created Oct 17, 2015
Workaround for bug with RecycleView focus scrolling when navigating with d-pad (
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
* {@link GridLayoutManager} extension which introduces workaround for focus finding bug when
* navigating with dpad.
* @see <a href=""></a>
stephenturner /
Last active Mar 6, 2022
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.


  • Forum response on using CERN's open Scientific Linux distribution of RHEL's developer toolset.
  • : CERN's developer toolset installation instructions.
View Android Color Control Cheat Sheet
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
nisrulz /
Created Apr 5, 2015
Android : Proguard Rules for a Library Module
# This ProGuard configuration file illustrates how to process a program
# library, such that it remains usable as a library.
# Usage:
# java -jar proguard.jar
# Save the obfuscation mapping to a file, so we can de-obfuscate any stack
# traces later on. Keep a fixed source file attribute and all line number
# tables to get line numbers in the stack traces.
gabrielemariotti /
Last active May 16, 2022
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 (

This is a porting of the class SimpleSectionedListAdapter provided by Google



cbeyls /
Last active May 4, 2020
A PreferenceFragment for the Android support library. Based on the platform's code with some removed features and a basic ListView layout.It uses reflection but works with every device I've tested so far.
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
aslakhellesoy /
Created Aug 9, 2011
Rounding up and down to nearest multiple
/** round n down to nearest multiple of m */
long roundDown(long n, long m) {
return n >= 0 ? (n / m) * m : ((n - m + 1) / m) * m;
/** round n up to nearest multiple of m */
long roundUp(long n, long m) {
return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m;