Skip to content

Instantly share code, notes, and snippets.

View ajaxray's full-sized avatar
🪁
Exploring

Anis uddin Ahmad ajaxray

🪁
Exploring
View GitHub Profile
@ajaxray
ajaxray / docker-compose.yml
Created November 15, 2023 08:56
[Database Course] MySQL 8.2 with Adminer
version: '3.7'
services:
db_course_mysql:
image: mysql:8.2
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: 123123
ports:
- 3309:3306
volumes:
@ajaxray
ajaxray / REST_with_curl.md
Last active September 6, 2023 18:51
Testing a REST API with curl

Testing REST API using curl

This gist lists only the basic commands to test REST APIs with curl. If you need something more advanced, this book has everything you may need.

Simple GET Requests

Display the response only

@ajaxray
ajaxray / SomeClassTest.php
Last active July 4, 2023 16:30
PHP mocking built-in functions (e,g exec, file_exists etc.) for testing
<?php
/**
* Example of mocking built-in functions for testing
*
* @Author : ajaxray <anis.programmer@gmail.com>
* @Date-Time : 03/05/2017
*
* How it works?
* ----------------
* Simply by redefining the function for target Namespace.
@ajaxray
ajaxray / CreateUser.php
Last active June 11, 2023 15:14
A Laravel Artisan command for creating user with name, email and password
<?php
namespace App\Console\Commands;
use App\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Validator;
class CreateUser extends Command
{
@ajaxray
ajaxray / select2-cascade.js
Last active November 23, 2022 07:27
Making Select2 (4.x) list boxes cascading / dependent. Options of a select2 list box will be loaded/refreshed by ajax based on selection of another select2 list box.
/**
* A Javascript module to loadeding/refreshing options of a select2 list box using ajax based on selection of another select2 list box.
*
* @url : https://gist.github.com/ajaxray/187e7c9a00666a7ffff52a8a69b8bf31
* @auther : Anis Uddin Ahmad <anis.programmer@gmail.com>
*
* Live demo - https://codepen.io/ajaxray/full/oBPbQe/
* w: http://ajaxray.com | t: @ajaxray
*/
var Select2Cascade = ( function(window, $) {
@ajaxray
ajaxray / backpack_customizations.css
Last active August 13, 2022 17:15
Make active/inactive status of simple filters clear and vivid (backpackforlaravel.com)
#bp-filters-navbar .nav-item[filter-type="simple"]:not(.active) a:before {
content: '️️️⬜️ '
}
#bp-filters-navbar .nav-item[filter-type="simple"].active a:before {
content: '️️️✅️ '
}
@ajaxray
ajaxray / wkhtmltopdf.sh
Last active August 9, 2022 03:28 — forked from Rajeshr34/wkhtmltopdf.sh
Install wkhtmltopdf with Patched QT for CentOS 7 or RHEL 7.x
cd ~
yum install -y xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl git-core fontconfig
wget https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin
# Thanks to
# https://jaimegris.wordpress.com/2015/03/04/how-to-install-wkhtmltopdf-in-centos-7-0/
# https://gist.github.com/Rajeshr34/2e9b2438ff142e51c729b4b9b772680a
@ajaxray
ajaxray / firebase-online-user-count-example.md
Last active July 18, 2022 09:57
Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally

Gathering.js - How to use

Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally.

Live Demo

Firebase Shared Checklist is a demo application that shows the number of users joined a checklist using gathering.js. Here is a 1 minute screencast of using this application.

@ajaxray
ajaxray / update_token.sh
Last active June 13, 2022 13:29
Shell script to update a yaml configuration using sed
echo "Replacing FB Access Token"
echo "--------------------\n"
# Displaying old value for reference
echo "### Old configuration"
grep ' access_token:' config.yml
echo "### New configuration"
echo " access_token: \"$1\""
sed -i "" "s/^\s+access_token: .*$/ access_token: \"${1}\"/" config.yml
@ajaxray
ajaxray / Dua.md
Created August 28, 2012 18:56
কুরাআন ও হাদিসে বর্নিত কিছু অসাধারন দোয়া

ঈমান ধরে রাখতে হলে আমাদের বেশী বেশী রাসুল(স) এর শিখিয়ে দেওয়া দুয়া পড়তে হবে, শয়তানের থেকে হেফাজতের জন্য আল্লাহ'র কাছে চাইতে হবে ।

আল্লাহ বলেন, "তোমরা আমাকে ডাকো, আমি তোমাদের ডাকে সারা দেব !" - [সূরা মুমিনঃ ৬০]

পবিত্র কুরআন শরিফ থেকে

  1. "হে আমাদের পালনকর্তা! সরল পথ প্রদর্শনের পর তুমি আমাদের অন্তরকে সত্যলংঘনে প্রবৃত্ত করোনা এবং তোমার নিকট থেকে আমাদিগকে অনুগ্রহ দান কর। তুমিই সব কিছুর দাতা।" - [সূরা আল-ইমরান - ০৮]