Skip to content

Instantly share code, notes, and snippets.

View rajibdpi's full-sized avatar
💻
Always try to discover something new

Rajib Ahmed rajibdpi

💻
Always try to discover something new
View GitHub Profile
@rajibdpi
rajibdpi / GPG error solved of mod-pagespeed EXPKEYSIG 78BD65473CB3BD13 Google Inc.md
Last active October 17, 2023 15:01
GPG error: http://dl.google.com/linux/mod-pagespeed/deb stable Release: The following signatures were invalid: EXPKEYSIG 78BD65473CB3BD13 Google Inc. (Linux Packages Signing Authority) <[email protected]> error solve.

GPG error: http://dl.google.com/linux/mod-pagespeed/deb stable Release: The following signatures were invalid: EXPKEYSIG 78BD65473CB3BD13 Google Inc. (Linux Packages Signing Authority) [email protected] error solve.

I'm checked on Ubuntu/Debian, might be slightly different on others distro.

Open Terminal/SSH Client

sudo nano /etc/apt/sources.list.d/mod-pagespeed.list       
# before: deb http://dl.google.com/linux/mod-pagespeed/deb/ stable main      
# after: #deb http://dl.google.com/linux/mod-pagespeed/deb/ stable main   
@rajibdpi
rajibdpi / deploy.yml
Created October 7, 2023 16:23 — forked from apgapg/deploy.yml
Github Workflow for Building, Releasing Flutter web app to Github Pages and Firebase Hosting
# This is a basic workflow to help you get started with Actions
name: Build, Release app to Github Pages and Firebase Hosting
# name: Test, Build and Release apk
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
@rajibdpi
rajibdpi / Response Status.md
Last active September 23, 2023 07:03
Created with Copy to Gist

200 Success
404 Not Found (page or other resource doesn't exist)
401 Not authorized (not logged in)
403 Logged in but access to requested area is forbidden
400 Bad request (something wrong with URL or parameters)
422 Unprocessable Entity (validation failed)
500 General server error

@rajibdpi
rajibdpi / bengali2english.php
Created July 22, 2023 15:27 — forked from nasirkhan/bengali2english.php
Convert a Bengali (Bangla) Number to English Number
/**
*
* Input any number in Bengali and the following function will return the English number.
*
*/
function bn2enNumber ($number){
$search_array= array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০");
$replace_array= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
$en_number = str_replace($search_array, $replace_array, $number);
@rajibdpi
rajibdpi / revertCommit.txt
Last active June 16, 2023 19:27
revert a Git repository to a previous commit?
git revert --no-commit 0766c053..HEAD
git commit
This will revert everything from the HEAD back to the commit hash, meaning it will recreate that commit state in the working tree as if every commit after 0766c053 had been walked back. You can then commit the current tree, and it will create a brand new commit essentially equivalent to the commit you "reverted" to.
(The --no-commit flag lets git revert all the commits at once- otherwise you'll be prompted for a message for each commit in the range, littering your history with unnecessary new commits.)
This is a safe and easy way to rollback to a previous state. No history is destroyed, so it can be used for commits that have already been made public.
@rajibdpi
rajibdpi / 4 commands should fix most of the permission issues on laravel.md
Last active May 28, 2023 04:07
How to solve Laravel showing "Failed to clear cache. Make sure you have the appropriate permissions"?

4 commands should fix most of the permission issues on laravel.

  1. sudo chown -R $USER:www-data storage
  2. sudo chown -R $USER:www-data bootstrap/cache
  3. chmod -R 775 storage
  4. chmod -R 775 bootstrap/cache
@rajibdpi
rajibdpi / index.html
Created February 15, 2023 14:27
jQuery Clone form
<div class="container">
<div class="row">
<div class="col-xs-12">
<form class="form-main">
<div class="form-block">
<div class="form-group">
Name
<input type="text" name="name[]" class="form-control">
</div>
<div class="form-group">
@rajibdpi
rajibdpi / System Design.md
Created October 11, 2022 16:53 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rajibdpi
rajibdpi / leetcode.json
Created October 1, 2022 05:43 — forked from justaguywhocodes/leetcode.json
LeetCode questions converted to JSON
This file has been truncated, but you can view the full file.
[{
"id": "1",
"title": "Two Sum",
"question": "Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nYou may assume that each input would have exactly one solution, and you may not use the same element twice.\nYou can return the answer in any order.",
"examples": [
"Input: nums = [2,7,11,15], target = 9",
"Output: [0,1]",
"Output: Because nums[0] + nums[1] == 9, we return [0, 1].",
"Input: nums = [3,2,4], target = 6",
"Output: [1,2]",
@rajibdpi
rajibdpi / card_filter.html
Last active June 20, 2022 19:32
Filter city cards based on select dropdown value on client side only
<script>
$(function() {
$('#cityselector').change(function(){
if($(this).val()=="All"){$('.city').show(); return;}else{$('.city').hide();}
$('.' + $(this).val()).show();
});
});
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="row">