Skip to content

Instantly share code, notes, and snippets.

@asifmujteba
asifmujteba / LICENSE
Created October 1, 2019 16:13
This license applies to all public gists https://gist.github.com/asifmujteba
MIT License
Copyright (c) 2017 Martin Buberl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@asifmujteba
asifmujteba / genstrings commands
Created May 29, 2015 12:06
genstring iOS generate strings for localization
To generate strings from *.m files located in the current folder execute:
$ genstrings -o en.lproj *.m
To generate strings from *.m files located in the current folder + subfolders execute:
$ find . -name \*.m | xargs genstrings -o en.lproj
To generate strings from *.m files located in the current folder + subfolders but excluding Folder1 execute:
$ find . -name \*.m -not -path "./Folder1/*" -print0 | xargs -0 genstrings -o en.lproj -1
@asifmujteba
asifmujteba / ASFUriHelper
Created April 22, 2015 06:31
Get Real Path from Uri
@TargetApi(Build.VERSION_CODES.KITKAT)
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
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:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@asifmujteba
asifmujteba / Important Links
Last active August 29, 2015 14:16
Important Links
@asifmujteba
asifmujteba / apk to bar conversion
Created October 17, 2014 12:01
Converting Android apk to Blackberry 10 bar file with the help of Blackberry Command-line Tools Using Terminal / Command Prompt
1- Download and setup Android SDk
2- Download and configure BB Tools from https://developer.blackberry.com/android/documentation/cmd_line_tools.html#alk1340635279567
3- Open terminal and move to blackberry.tools.SDK/bin directory
cd /path_to_dir/blackberry.tools.SDK/bin
4- Convert apk to bar
./apk2bar /path_to_apk/myApp.apk "/path_to_android_sdk/sdk"
@asifmujteba
asifmujteba / SVN Help
Last active August 29, 2015 14:07
svn scripts for quick viewing
# Creating branch
svn copy project/trunk project/branches/new-branch -m "Creating a new branch of project/trunk"
# Deleting branch
cd project/branhces
svn rm new-branch/
svn commit -m "Deleting obsolete branch"
@asifmujteba
asifmujteba / styles_noactionbar.xml
Last active August 29, 2015 14:05 — forked from tshrkmd/styles_noactionbar.xml
Add it in styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item> <!-- For 2.x version -->
</style>
</resources>