Skip to content

Instantly share code, notes, and snippets.

View tojibon's full-sized avatar

Juyal Ahmed tojibon

View GitHub Profile
tojibon / paper-canvas.vue
Created November 21, 2023 11:24 — forked from RobinMoretti/paper-canvas.vue
Simple PaperJs integration in a vuejs 3 component
<script setup>
import paper from "paper"
import { ref, onMounted } from 'vue'
const canvas = ref(null)
var path = new paper.Path();
path.strokeColor = 'black';
tojibon /
Created January 27, 2022 10:49 — forked from tomysmile/
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
tojibon / AppServiceProvider.php
Created December 13, 2021 09:34 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
public function boot()
tojibon /
Last active March 20, 2020 11:01 — forked from skynet/
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
# Must be ran as sudo:
# sudo bash
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
tojibon /
Last active November 20, 2019 15:36
Installing AWS KubeCTL on Windows
  1. Visit and install AWS CLI Client
  2. Visit and install Kubernetes CLI Client
  3. Configure AWS CLI - aws configure
Default region name [None]: eu-central-1
Default output format [None]: JSON
  1. Configure Amazon EKS (Elastic Kubernetes Service) - aws eks --region eu-central-1 update-kubeconfig --name phpfarmer-kube1
tojibon /
Last active May 9, 2019 15:26
Search for a specific column name in all the tables in MySQL database?
    table_schema = 'DB_NAME' AND    
tojibon / composer.json
Last active May 8, 2019 13:51
Creating a package with Laravel 5.6 for a printing company ex: Alpha and the package name ex: Library.
"autoload": {
"classmap": [
"psr-4": {
"App\\": "app/",
"Alpha\\Library\\": "packages/Library/src/"
tojibon / readme.MD
Last active May 27, 2019 08:56
My Laravel Best Practices
  • Always follow PSR2 - PSR4 php coding style, better install it on PHPStorm
  • Always validate things via RequestValidators even if it is nullable(), Move validation from controllers to Request classes.
  • Use child relationships to get child data and filter data
  • Make sure if there is any auto generated codes like __construct
  • How can a array count ever be less than 0? Check to use a simple condition instead of making it complex with double check
  • Check if there is anything should actually fail if it doesn't have a set value
  • It's a good idea to check first for the less costly conditions (especially inside a loop)
  • Always use Carbon for date processing
  • Maintain code commenting and proper docblock
  • Always use custom env for static values, do not get data from the .env file directly
tojibon /
Last active April 27, 2019 22:43
Setting up VirtualHost for Symfony App in Ubuntu
sudo vim /etc/apache2/sites-available/symfony-test-app.conf
<VirtualHost *:80>
  <IfModule mod_rewrite.c>
 RewriteEngine on
tojibon / api.php
Last active April 17, 2019 08:04
Laravel fire an Artisan command from an HTTP route by using Artisan facade
Route::get('/foo', function()
$exitCode = Artisan::call('command:name', ['--option' => 'foo']);