Skip to content

Instantly share code, notes, and snippets.

View shihabmi7's full-sized avatar
🎯
Focusing

Muhammad Shihab Uddin shihabmi7

🎯
Focusing
  • Malaysia
View GitHub Profile
@shihabmi7
shihabmi7 / command
Created October 22, 2018 14:55
mysql_mac_command
sudo mysql -u root -p
-> password: your_pc_password
-> password (again): (this_time_your_mysql_password)
@shihabmi7
shihabmi7 / Android Studio .gitignore
Created October 12, 2018 10:01 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@shihabmi7
shihabmi7 / TextJustifyUtils
Last active October 5, 2018 13:15
TextViewEx Justify Android TextView
package com.sebpo.nearme.utility;
import android.graphics.Paint;
import android.view.Gravity;
import android.widget.TextView;
/*!
*
* TextJustifyUtils.java
* @author Nikhil Lohia
@shihabmi7
shihabmi7 / fab.xml
Last active September 24, 2018 13:18
FAB Use
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_fav"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:tint="@color/app_white"
android:layout_margin="16dp"
android:src="@drawable/baseline_favorite_white_dp"
app:backgroundTint="@color/colorPrimaryDark" />
@shihabmi7
shihabmi7 / program.cpp
Last active July 23, 2018 12:33
C program
#include <stdio.h>
#include <stdlib.h>
void arraySizeDetect()
{
int numbers[5] = {10,20,30,40,50};
int value = sizeof(numbers)/sizeof(int);
String CHANNEL_ID = "0";
int importance = NotificationManager.IMPORTANCE_HIGH;
public static final int NOTIFICATION_ID = 100;
private NotificationManager notifManager;
private NotificationChannel mChannel;
private void startStickyNotification() {
Intent resultIntent = new Intent(this, LoadingActivity.class);
@shihabmi7
shihabmi7 / bd.json
Created May 28, 2018 04:52
Bangladesh polygon.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shihabmi7
shihabmi7 / save_to_internal_storage
Created April 16, 2018 11:36
save_to_internal_storage
// == SAVE IMAGE IN EXTERNAL DIRECTORY ==== //
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
// path to internal Card
File path = getFilesDir();
// create a folder
File dir = new File(path + "/save/");
dir.mkdirs();
File file = new File(dir, "shihab.png");
OutputStream outputStream = null;
@shihabmi7
shihabmi7 / ShortcutIcon
Last active February 25, 2018 11:51
appShortCut
/**
* Don't forget to change activity name, icon resource & permission.
*/
private void ShortcutIcon() {
Intent shortcutIntent = new Intent(getApplicationContext(), ShortCutAppIcon.class);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Intent addIntent = new Intent();
public static List<String> getListOfFakeLocationApps(Context context) {
List<String> runningApps = getRunningApps(context, false);
for (int i = runningApps.size() - 1; i >= 0; i--) {
String app = runningApps.get(i);
if(!hasAppPermission(context, app, "android.permission.ACCESS_MOCK_LOCATION")){
runningApps.remove(i);
}
}
return runningApps;
}