Skip to content

Instantly share code, notes, and snippets.

View AHS12's full-sized avatar
🌎
Working in a hybrid schedule

Azizul Hakim AHS12

🌎
Working in a hybrid schedule
View GitHub Profile
@AHS12
AHS12 / CustomHelper.php
Created May 23, 2022 18:19 — forked from reazul-islam/CustomHelper.php
English format to bangla on the run time
<?php
class Helper
{
public static $bn = ['১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯', '০'];
public static $en = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'];
public static function bn2en($number)
{
@AHS12
AHS12 / mysql_countries.sql
Created September 29, 2021 05:40 — forked from kamermans/mysql_countries.sql
MySQL Dump - continents and countries with 2 and 3 char codes, names and full names - Braintree compatible as of Dec 2011
/**
* Continents and Countries MySQL Tables compiled from Wikipedia, Braintree Payments documentation
* and a couple other places I don't recall at the moment. This data is compatible with the Braintree
* Payment API as of Dec 2011
*
* Compiled by Steve Kamerman, 2011
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
@AHS12
AHS12 / AppServiceProvider.php
Created September 6, 2021 08:27 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@AHS12
AHS12 / AccessToken.php
Created July 10, 2021 12:54 — forked from onamfc/AccessToken.php
Add Custom Claims to Passport 8 / Laravel 6
<?php
namespace App\Passport;
use App\User;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use League\OAuth2\Server\CryptKey;
use Lcobucci\JWT\Signer\Rsa\Sha256;
use Laravel\Passport\Bridge\AccessToken as BaseToken;
@AHS12
AHS12 / paginate.php
Created April 17, 2021 07:42 — forked from wuiler/paginate.php
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@AHS12
AHS12 / download-file.js
Created January 26, 2021 11:00 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);