Skip to content

Instantly share code, notes, and snippets.

:octocat:
Finalizing

Juyal Ahmed tojibon

Block or report user

Report or block tojibon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tojibon
tojibon / readme.MD
Last active May 15, 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 12, 2019
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 / 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/
@tojibon
tojibon / mysql.md
Last active May 9, 2019
Search for a specific column name in all the tables in MySQL database?
View mysql.md
SELECT    
    table_name, 
    ordinal_position    
FROM INFORMATION_SCHEMA.COLUMNS    
WHERE    
    table_schema = 'DB_NAME' AND    
    column_name='column_name';
@tojibon
tojibon / composer.json
Last active May 8, 2019
Creating a package with Laravel 5.6 for a printing company ex: Alpha and the package name ex: Library.
View composer.json
{
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/",
"Alpha\\Library\\": "packages/Library/src/"
}
@tojibon
tojibon / readme.md
Created Sep 11, 2018
GIT Ignoring last few commits and roll back to existing target commit
View readme.md
git reset --hard 2467b9ebcc4f2487b4da5c9070e92913dc219842
git rebase -i master
git add .
git commit -m "reverted to 2467b9"
git push -f origin master
@tojibon
tojibon / readme.md
Created Aug 30, 2018
Multi Account Git
View readme.md
ssh-keygen -t rsa
ssh-add ~/.ssh/id_rsa

ssh-keygen -t rsa -C "companyName" -f "companyName"
ssh-add ~/.ssh/companyName
nano ~/.ssh/config
@tojibon
tojibon / gitflow-breakdown.md
Created Apr 1, 2019 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@tojibon
tojibon / readme.md
Last active Apr 27, 2019
Setting up VirtualHost for Symfony App in Ubuntu
View readme.md
sudo vim /etc/apache2/sites-available/symfony-test-app.conf
<VirtualHost *:80>
  ServerName symfony-test-app.com
  <IfModule mod_rewrite.c>
    RewriteEngine on
@tojibon
tojibon / Application.js
Created Sep 29, 2016
Summernote image upload and save on server instead of base64 data saving on Database.
View Application.js
Application.prototype.initSummerNoteJS = function() {
var $this = this;
$('#description').summernote({
height: 300, //set editable area's height
onImageUpload: function(files, editor, $editable) {
$this.sendFile(files[0],editor,$editable);
}
});
}
You can’t perform that action at this time.