Skip to content

Instantly share code, notes, and snippets.

View shibbirweb's full-sized avatar
Happy Coding

MD. Shibbir Ahmed shibbirweb

Happy Coding
View GitHub Profile
@shibbirweb
shibbirweb / CustomRecyclerAdapter.java
Created September 21, 2018 06:31
[Android] Add Context Menu to RecyclerView with click method by interface (Control from YourActivity.java)
//import package, classes etc;
public class CustomRecyclerAdapter extends RecyclerView.Adapter<CustomRecyclerAdapter.ViewHolder> {
private Context context;
private List<ModelClass> allData = new ArrayList<ModelClass>();
private OnItemClickListener onItemClickListener;
private OnCreateContextMenu onCreateContextMenu;
private OnContextMenuItemClickListener onContextMenuItemClickListener;
@shibbirweb
shibbirweb / CustomArrayAdapter.java
Created September 21, 2018 21:31
[Android] Custom Array Adapter for ListView with ViewHolder class
public class CustomArrayAdapter extends ArrayAdapter {
// declare your custom list with type;
private List<YourModelClass> allData = new ArrayList<YourModelClass>();
public CustomArrayAdapter(@NonNull Context context, List<YourModelClass> allData) {
super(context, R.layout.your_layout, allData); // add your_layout.xml
this.allData = allData;
}
@shibbirweb
shibbirweb / mysqliPDOtoJSON.php
Created September 23, 2018 16:19
[MySqli to JSON] Convert MySqli Database to JSON format by PHP (PDO)
<?php
$database_name = "your_database_name"; //database name
$database_username = "your_database_username"; // database username
$database_user_password = "your_database_user_password"; //database user password
$table_name = "your_table_name"; // your table name
try {
$db = new PDO('mysql:host=localhost;dbname=' . $database_name . ';charset=utf8', $database_username, $database_user_password);
//echo "Connected";
@shibbirweb
shibbirweb / AnyName.java
Created October 6, 2018 20:47
Using RequestOptions in Glide v4
//android studio dependency implementation 'com.github.bumptech.glide:glide:4.8.0'
RequestOptions options = new RequestOptions()
.centerCrop()
.placeholder(R.drawable.default_avatar)
.error(R.drawable.default_avatar)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.priority(Priority.HIGH);
@shibbirweb
shibbirweb / .htaccess
Created November 11, 2018 12:45
[Laravel] If object not found after move index.php file from public folder to root directory use this .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /your_directory_name_here/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
@shibbirweb
shibbirweb / BestPlugins.txt
Last active February 5, 2019 21:41
Editor useful plugins for a developer
===============
Sublime Text 3
===============
1. AdvancedNewFile
2. All Autocomplete
3. Auto Semi-Colin
4. AutoFileName
5. ayu
6. Blade Snippets
7. Bootstrap 4 Autocomplete
@shibbirweb
shibbirweb / Setting Process.txt
Created January 2, 2019 08:34
Setting up PhpStorm for laravel with autocompletion
You must already have php and laravel installed in your machine.
If you haven’t already a laravel project simply create a new project
then create a new laravel project from your Terminal with
laravel new
Setup your composer for PhpStorm
@shibbirweb
shibbirweb / index.html
Last active January 2, 2019 12:36
Add and Remove Class in jQuery
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<!-- Ionicons CSS -->
@shibbirweb
shibbirweb / index.html
Created January 10, 2019 09:32
jQuery Sidebar Toggle
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sidebar Show Hide</title>
<style type="text/css">
.sidebar{
position: fixed;
background-color: #dcdcdc;
height: 100%;
@shibbirweb
shibbirweb / scroll.html
Created February 12, 2019 17:45
Vertical Content Scroll
<style type="text/css">
#marqueecontainer{
position: relative;
width: auto; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
overflow: hidden;
padding: 2px;
padding-left: 4px;