Skip to content

Instantly share code, notes, and snippets.

View gohilbhagirath90's full-sized avatar

Bhagirathsinh Gohil gohilbhagirath90

  • eInfochips
  • Ahmedabad, Gujarat, India
View GitHub Profile
@gohilbhagirath90
gohilbhagirath90 / build cts command
Last active September 4, 2015 06:48
build cts command
make cts -j8 TARGET_PRODUCT=msm8960
@gohilbhagirath90
gohilbhagirath90 / gist:ffabeaa7294fde9ce1af
Created September 2, 2015 04:58
dynamically set width of navigation drawer
http://stackoverflow.com/questions/21038058/android-set-navigation-drawer-list-to-open-exact-half-of-the-screen-for-all-devi
mDrawerLayout = (DrawerLayout) view.findViewById(R.id.drawer_layout);
mDrawerList = (ListView) view.findViewById(R.id.top_sectionlist);
int width = getResources().getDisplayMetrics().widthPixels/2;
DrawerLayout.LayoutParams params = (android.support.v4.widget.DrawerLayout.LayoutParams) mDrawerList.getLayoutParams();
params.width = width;
mDrawerList.setLayoutParams(params);
@gohilbhagirath90
gohilbhagirath90 / multi_user_android_5.1
Last active August 29, 2015 14:28
multi user enable in android 5.1
It is supported, but you must have rooted device.
Download file manager that allows root access(for example: ES File Explorer)
Navigate to /system/
Backup build.prop
Add these lines at the end of build.prop file:
@gohilbhagirath90
gohilbhagirath90 / git
Created August 13, 2015 11:07
git merage
git branch
git checkout bhagirath
git log
git checkout master
git log
git merge bhagirath
git log
git branch
@gohilbhagirath90
gohilbhagirath90 / Test.sh
Created August 1, 2015 12:05
script for continue running scripts android
#!/bin/sh
for var in 0 1 2 3 4 5 6 7 8 9
do
echo "Test : $var"
adb install -r antutu.apk
./monkeyrunner AntutuTest.py
done
@gohilbhagirath90
gohilbhagirath90 / MonkeyRunnerTest.py
Created August 1, 2015 12:03
monkey runner script
import signal
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import commands
import sys
def execute():
running = True
while running:
# starting script
@gohilbhagirath90
gohilbhagirath90 / getRoundedBitmap.java
Last active August 29, 2015 14:25 — forked from eveliotc/getRoundedBitmap.java
A better yet dirty way of get rounded avatars
public static Bitmap getRoundedBitmap(Bitmap bitmap) {
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(output);
final int color = Color.RED;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
@gohilbhagirath90
gohilbhagirath90 / wifiTest
Created May 19, 2015 09:25
How to test WLAN function via command line
When a PCB back from product line without LCD, how to test WIFI basic function?
We can usually use below commands in adb shell with root permission
//Check if wlan.ko was loaded
lsmod
//If not, please install it
insmod /system/lib/modules/wlan.ko
//Check if it correctly installed
@gohilbhagirath90
gohilbhagirath90 / add_git.sh
Created May 7, 2015 08:56
adding project to git
#!/bin/bash
git init
echo "git init successfully"
git status
echo "git status"
git add -f *
echo "adding files successfully"
echo "set-up email & name"
@gohilbhagirath90
gohilbhagirath90 / ffmpeg
Last active May 27, 2017 09:49
ffmpeg decode command
==> ffmpeg decode video
ffmpeg -i Untitled_Project-Apple_ProRes_422.mov -f rawvideo -pix_fmt yuv420p Untitled_Project-Apple_ProRes_422.yuv
==> ffmpeg slicing video
ffmpeg -i Untitled_Project-Apple_ProRes_422.mov -pix_fmt yuv420p -ss 00:00:00 -t 00:00:15 part1_420p.mov
==> adding into container format