Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Download the following ZIPs:
ARM Translation Installer v1.1 (http://goo.gl/tfjjMt)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358558856 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@mandhor
mandhor / CustomMarkerGenerator
Last active August 29, 2015 14:18
Custom GoogleMap marker with text drawn
//add dependency: com.google.maps.android:android-maps-utils:0.3.4
GoogleMap map; //map reference
LatLng point; //LatLng point reference
String markerText = "123"; //text on marker
IconGenerator iconFactory = new IconGenerator(context);
iconFactory.setBackground(context.getResources().getDrawable(R.drawable.custom_marker));
iconFactory.setTextAppearance(context, R.style.custom_text_apperance);
Bitmap icon = iconFactory.makeIcon(markerText);
@mandhor
mandhor / gist:0443ddf151ab2bdbdffc
Last active May 29, 2019 19:46
[ SOLUTION ] JSON REST API returning List of different objects - source of LinkedTreeMap problem when deserializing data
// Source of problem
// JSON output from API
[
{
"id": 1,
"created_at": "01-06-2014",
"type": "message",
"text": "Hi there!",
"from": {
@mandhor
mandhor / burgerArrowTransition.java
Created April 6, 2015 17:13
Android - method for animating ActionBarDrawerToggle between hamburger (drawer) and back arrow (home)
android.support.v7.app.ActionBarDrawerToggle mDrawerToggle;
android.support.v4.widget.DrawerLayout mDrawerLayout;
public void burgerArrowTransition(final boolean burgerToArrow) {
float start, end;
mDrawerToggle.setDrawerIndicatorEnabled(true);
if(burgerToArrow) {
start = 0.0f;
@mandhor
mandhor / gist:92ce23904437d83e673d
Created April 6, 2015 21:54
[ SOLUTION ] SwipeRefreshLayout spinner not showing when .setRefreshing(true) called right after creating Fragment. ( android bug solution swiperefreshlayout pull to refresh not showing )
TypedValue typed_value = new TypedValue();
getActivity().getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, typed_value, true);
mSwipeRefreshLayout.setProgressViewOffset(false, 0, getResources().getDimensionPixelSize(typed_value.resourceId));
@mandhor
mandhor / gist:e89d2547eaad7b9ab82b
Created April 6, 2015 21:58
Convert DP to PX ( android dip dp pixels px )
int dp = 123;
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics());
@mandhor
mandhor / swipeRefreshLayoutRecyclerView.java
Created April 8, 2015 21:53
SwipeRefreshLayout RecyclerView bug workaround (SwipeRefreshLayout catches scroll up too early - not on top of the list - making it impossible to scroll up recyclerview)
//we have to keep current scroll value somewhere in our fragment
private int overallYScroll = 0;
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
overallYScroll = overallYScroll + dy;
@mandhor
mandhor / noip2
Created April 18, 2015 10:49
noip2 init.d
#! /bin/sh
# /etc/init.d/noip2
### BEGIN INIT INFO
# Provides: noip2
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
@mandhor
mandhor / redis-migrate.sh
Created March 22, 2017 08:18 — forked from nicStuff/redis-migrate.sh
Comfort tool for migrating redis keys among instances. Supports KEYS syntax matching, authentication and TTL
#!/bin/bash
######
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
######
@mandhor
mandhor / lockrun.c
Created April 7, 2017 13:55
lockrun.c
/*
* $Id: //websites/unixwiz/unixwiz.net/webroot/tools/lockrun.c#8 $
*
* written by : Stephen J. Friedl
* Software Consultant
* Southern California USA
* steve@unixwiz.net
* http://www.unixwiz.net/tools/
*
* ===================================================================