Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Finalizing

Juyal Ahmed tojibon

:octocat:
Finalizing
View GitHub Profile
@tojibon
tojibon / Install.md
Last active May 8, 2021
Installing and Configuring ImageMagick on Xampp
View Install.md

#Steps to Install

  1. Download and Install ImageMagick http://imagemagick.org/script/binary-releases.php#windows
  2. Visit ImageMagic installation directory and module/coders copy all files and past on D:\xampp\apache\bin
  3. Download Binary https://pecl.php.net/package/imagick/3.4.0RC5/windows php 5.6 TS one according to phpinfo Architecture if it is x86/x64
  4. Exatract and copy php_imagick.dll to D:\xampp\php\ext
  5. Add php_imagick.dll on php.ini
  6. Copy 8 CORE_*.dll to D:\xampp\apache\bin
  7. Restart Apache
  8. done and visit phpinfo
@tojibon
tojibon / IndexController.php
Last active Feb 18, 2021
Curl get request in Laravel controller with cache support.
View IndexController.php
<?php
namespace App\Http\Controllers;
class InfoController extends Controller
{
/*
*
* Checking if cache file exist
* @ param string $name cache file name
@tojibon
tojibon / install.md
Created Dec 15, 2016
Installing Spring STS or Eclipse IDE on Linux Mint 18 "Sarah"
View install.md
  1. Download https://spring.io/tools latests
  2. Rename the extracted bundle as "springsource"
  3. sudo mv springsource /opt
  4. sudo chown -R root:root /opt/springsource
  5. sudo chmod -R +r /opt/springsource
  6. sudo cp /opt/springsource/sts-3.8.2.RELEASE/icon.xpm /usr/share/pixmaps/sts.xpm [Your version can be different]
  7. sudo touch /usr/share/applications/sts.desktop<<EOF [Desktop Entry] Encoding=UTF-8 Name=Spring IDE
@tojibon
tojibon / GmailController.js
Last active Jan 13, 2021
OAuth2 google authentication and saving information on MongoDB database and later use the token / refreshtoken to retrieve profile information.
View GmailController.js
/**
* Admin/GmailController
*
* @description :: Server-side logic for managing admin/gmails
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
Help Links:
https://github.com/mscdex/node-imap
https://github.com/pipedrive/inbox
https://github.com/google/google-api-nodejs-client
@tojibon
tojibon / app.js
Created Sep 11, 2015
Using DynamoDB with Node.js, Express.js
View app.js
var aws_router = require('./routes/aws');
app.use('/aws', aws_router);
//npm install aws-sdk
//visit http://localhost:3000/aws/table-list
@tojibon
tojibon / upgrade-php7.sh
Last active Mar 20, 2020 — forked from skynet/upgrade-php7.sh
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
View upgrade-php7.sh
#!/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 upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
@tojibon
tojibon / readme.md
Last active Nov 20, 2019
Installing AWS KubeCTL on Windows
View readme.md
  1. Visit https://aws.amazon.com/cli/ and install AWS CLI Client
  2. Visit https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows and install Kubernetes CLI Client
  3. Configure AWS CLI - aws configure
AWS Access Key ID [None]: AKIAJXXXXXXEWDNXXXXX
AWS Secret Access Key [None]: 2EqCQXXXXXuK3LXXXXXtZXMGNXXXXXVCHd0XXXXX
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
View Artisan.md
// Added in 5.1.11:http://laravel.com/docs/5.1/authorization#creating-policies
php artisan make:policy PostPolicy
// Displays help for a given command
php artisan --help OR -h
// Do not output any message
php artisan --quiet OR -q
// Display this application version
php artisan --version OR -V
// Do not ask any interactive question
@tojibon
tojibon / readme.MD
Last active May 27, 2019
My Laravel Best Practices
View readme.MD
  • 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
tojibon / install.md
Last active May 9, 2019
Installing Croogo 3.0.0-alpha.3 with CakePHP 3.x
View install.md
composer create-project croogo/app croogoapp 3.0.x-dev 
cd croogoapp
bin/cake Croogo/Install.install admin admin
bin/cake server

sudo chmod -R 0777 ./tmp/cache/queries/
sudo chmod -R 0777 ./tmp/cache/persistent/