Skip to content

Instantly share code, notes, and snippets.

@fazni
fazni / gist-switch-between-multiple-php-versions-in-ubuntu.md
Last active March 31, 2020 10:12
Switch Between Multiple PHP Versions In Ubuntu

Switch from PHP7.x to PHP7.x

sudo a2dismod php7.1

sudo a2enmod php7.3

To activate the new configuration, you need to run:

systemctl restart apache2

  1. sudo update-alternatives --set php /usr/bin/php7.3
  2. sudo update-alternatives --set phar /usr/bin/phar7.3
# Run
git config --global credential.helper store
#Then
git pull
#provide a username and password and those details will then be remembered later. The credentials are stored in a file on the disk, with the disk permissions of "just user readable/writable" but still in plaintext.
@fazni
fazni / README-Template.md
Created May 23, 2019 09:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

$form['file'] = [
'#type' => 'managed_file',
'#title' => t('File'),
'#upload_location' => 'public://file',
'#upload_validators' => [
'file_validate_extensions' => ['csv'],
],
'#default_value' => array(2)
];
@fazni
fazni / code-review-checklist.md
Created April 28, 2019 14:17 — forked from nerandell/code-review-checklist.md
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers
@fazni
fazni / copy_content.mkd
Created April 19, 2019 16:16 — forked from appleboy/copy_content.mkd
Copy all branch from another repository?

Repository url

origin: https://github.com/appleboy/git-test
remote: https://github.com/appleboy/html5-template-engine

Copy all branch from another repository

@fazni
fazni / AddAnotherItem.php
Created December 2, 2018 15:06 — forked from normanlolx/AddAnotherItem.php
Drupal 8 Ajax Form Add Item Example
<?php
/**
* @file
* Contains \Drupal\hello_world\Form\AddAnotherItem.
*/
namespace Drupal\hello_world\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
@fazni
fazni / drupal-PSA-003-check.sh
Created April 25, 2018 16:47 — forked from jerbob92/drupal-PSA-003-check.sh
Check whether Drupal 7.59 and 8.5.3 are released
#!/bin/sh
url="https://ftp.drupal.org/files/projects/drupal-7.59.zip";
if curl --output /dev/null --silent --head --fail "$url"; then
echo "URL exists: $url";
else
echo "URL does not exist: $url";
fi;
url="https://ftp.drupal.org/files/projects/drupal-8.5.3.zip";
@fazni
fazni / SettingUpMailcatcher.md
Last active May 23, 2018 10:27
Setting Up Mailcatcher

1 - Ruby Installation
sudo apt-get install ruby ruby-dev rubygems libsqlite3-dev
2 - Installing MailCatcher sudo gem install mailcatcher
3 - Getting started
[fazni]-[~] "Terminal" $ mailcatcher Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080