Skip to content

Instantly share code, notes, and snippets.

@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 / 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
$form['file'] = [
'#type' => 'managed_file',
'#title' => t('File'),
'#upload_location' => 'public://file',
'#upload_validators' => [
'file_validate_extensions' => ['csv'],
],
'#default_value' => array(2)
];
@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

# 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 / 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
@fazni
fazni / gist:f5759fb6b3098026a7d404bc0e5af574
Created October 24, 2019 12:14 — forked from luisbosque/gist:5513fa88b5087434089d
Export to csv format the list of remote branches and their "owners"
for i in `git branch -a |grep remotes |awk '{print $1}' | cut -d"/" -f 3,4,5 |grep -v ^master$ |grep -v ^HEAD$`; do echo "`git log -1 --pretty=format:\"%an (%ae)\" origin/$i`|$i"; done |sort > /tmp/branches.csv
@fazni
fazni / gist:3af40ba86de29d3562212c5733566818
Created January 30, 2020 09:33
Updates the installed version information for a module.
drush ev "drupal_set_installed_schema_version('module_name', 8801)"
@fazni
fazni / Cheat sheet Drupal 8.md
Last active March 31, 2020 10:10
Cheat sheet Drupal 8

Run a single specific Drupal update hook using Drush

drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();"