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
@fadhifatah
fadhifatah / AdaptiveSpacingItemDecoration.kt
Created March 8, 2022 07:59
New file: AdaptiveSpacingItemDecoration to help solve spacing problem inside RecyclerView
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView.ItemDecoration
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
/**
* Give equal margin around each [RecyclerView] items, adaptively. Supports known direct subclasses of
@viktorsml
viktorsml / Microsoft.PowerShell_profile.ps1
Last active September 2, 2023 09:57
Custom PowerShell Profile
# Prompt Theme
Set-PoshPrompt -Theme R:\personal-environment\scripts\powershell\custom-theme.json
Remove-Alias cd
# Modules
Import-Module npm-completion
Import-Module Terminal-Icons
Import-Module PSReadline -RequiredVersion 2.2.0
@onlime
onlime / .eslintrc.js
Created August 30, 2021 21:37
Configure ESLint and Prettier for Vue/Nuxt.js project in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false,
},
@ChristopherME
ChristopherME / recyclerview-fix-leak-extension.kt
Last active March 25, 2023 14:05
This extension method is a solution for a memory leak problem with recyclerviews.
/**
* Set the adapter and call [clearReference] extension function in one call.
* Use this extension if the current Fragment is going to be REPLACED. (When using fragmentTransaction.add is not necessary) the back stack.
*/
fun <VH : RecyclerView.ViewHolder> RecyclerView.setNullableAdapter(
adapter: RecyclerView.Adapter<VH>
) {
this.adapter = adapter
this.clearReference()
@FhdAlotaibi
FhdAlotaibi / DownloadProgressLiveData.kt
Last active November 20, 2023 11:27
Observe Download manager progress using LiveData and Coroutine
data class DownloadItem(val bytesDownloadedSoFar: Long = -1, val totalSizeBytes: Long = -1, val status: Int)
class DownloadProgressLiveData(private val application: Application, private val requestId: Long) : LiveData<DownloadItem>(), CoroutineScope {
private val downloadManager by lazy {
application.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
}
private val job = Job()
@kdamsmt
kdamsmt / Balsamiq Mockups 3.5.17
Last active March 5, 2024 13:28
Balsamiq Mockups 3.5.17 for Desktop full license key (Tested) or Balsamiq Wireframes for Desktop
Balsamiq Wireframes for Desktop full license key free
This old name is Balsamiq Mockups now the company changing the name to Balsamiq Wireframes for Desktop insteed
HOW TO:
First download softwere here: https://balsamiq.com/wireframes/desktop/
Install and follow screen direction
Use below serial:
=====================================================================================
@alwarren
alwarren / RetrofitRepo.kt
Last active March 16, 2023 21:52
Using generics with Retrofit repositories. A work in progress.
package com.example.domain.api
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
open class RetrofitRepo<out S>(clazz: Class<S>) {
val service: S = Api.service(clazz)
@dusta
dusta / Deploy_on_cPanel.md
Last active April 22, 2024 18:16 — forked from oodavid/README.md
Deploy your site with git on cPanel

Deploy your site with git on cPanel

The most important: You must have shell access!

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
  • your (PHP) scripts are served from /var/www/html/
@julienroubieu
julienroubieu / npm-install-all.sh
Created November 1, 2017 16:32
Run npm install in all subdirectories
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \;
@sergomet
sergomet / GoogleDriveServiceProvider.php
Created April 1, 2017 07:01 — forked from ivanvermeyen/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.