Skip to content

Instantly share code, notes, and snippets.

View mohokh67's full-sized avatar
💭
Working hard, typing slow 😎😎

MoHo mohokh67

💭
Working hard, typing slow 😎😎
View GitHub Profile
@mohokh67
mohokh67 / vscodeInstalledPackages.md
Last active January 28, 2023 06:38
List of my vscode packages

Run this command and it will give you list of in installed packages:

code --list-extensions | xargs -L 1 echo code --install-extension

I have this packages:

code --install-extension christian-kohler.path-intellisense
@mohokh67
mohokh67 / nodemon_babel.json
Created July 9, 2018 12:42
Run Nodemon with BabelJs
{
"name": "Babel with Nodemon",
"version": "1.0.0",
"description": "",
"main": "public/index.js",
"scripts": {
"start": "node ./public/index.js",
"start:dev": "nodemon ./public/index.js",
"clean": "rm -rf dist",
"build": "npm run clean && mkdir dist && babel app -d dist --copy-files",
@mohokh67
mohokh67 / async_await.js
Created July 6, 2018 14:04
JavaScript ES6 async await
function doubleMe(name, x) {
console.log('I am running ' + name);
return new Promise(resolve => {
setTimeout(() => {
resolve(x * 2);
console.log('hoooo');
}, 2000);
});
}
@mohokh67
mohokh67 / Run PHPUnit from PHPStorm.md
Created January 24, 2018 15:49
Run PHPUnit from PHPStorm

Run PHPUnit from PHPStorm

  1. Under settings dialog, go to test framework (e.g. under PHP language)
  2. Add a test framework
  3. Choose Composer autoloader
  4. Choose vendor/autoload.php
  5. Choose phpunit.xml in the current project for the default configuration file
  • Go to test directory where it contains all the PHPUnit tests, right click and choose run test or do the same on every individual tests file
@mohokh67
mohokh67 / Xdebug.md
Last active January 24, 2018 15:47
Configure XDEBUG and PHPStorm

Configure Xdebug

  1. Copy all phpinfo() output to this URL: https://xdebug.org/wizard.php
  2. Copy the file and follow the instrcution
  3. Add follow lines to the end of php.ini to make it work with PHPStorm
[XDEBUG]
zend_extension = C:\xampp\php\ext\php_xdebug-2.5.4-7.1-vc14.dll
xdebug.remote_enable = true
xdebug.idekey = PHPSTORM
@mohokh67
mohokh67 / fix gitignore.md
Last active September 14, 2023 14:09
Fix the .gitignore and untrack files which are already added

Untrack files which are already added in gitignore file

  1. Commit all your changes

  2. Remove everything from the repository cache. Go to your repo directory and run this command.

git rm -r --cached .

It will only clear the cache. Your files and git history will stay.

@mohokh67
mohokh67 / Install PHP 7.1 with Nginx on Ubuntu 17.10.md
Created January 23, 2018 08:09
Install PHP 7.1 with Nginx on Ubuntu 17.10

Install PHP 7.1 with Nginx on Ubuntu 17.10

Follow these steps to inatll php 7.1 and most common modules:

sudo apt-get update
  • Install PHP 7.1
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@mohokh67
mohokh67 / Install nginx, php7.1 and setup a virtual host in ubuntu.md
Last active January 23, 2018 08:10
How to install nginx, php7.1 and setup a virtual host in Ubuntu

Install Nginx and add a virtual host

  • First, make sure the Ubuntu Repo. is up to date.
sudo apt-get update
  • Check if Nginx is install in you machine:
nginx -v
@mohokh67
mohokh67 / Install Composer in Ubuntu.md
Last active February 10, 2018 13:05
Install Composer in Ubuntu

How to install composer in Ubuntu

In this short article we are going to install composer php packages manager in Ubuntu 16 and above.

  • Make sure php is installed by typing php -v in terminal. otherwise install PHP with this command:
sudo apt-get update
sudo apt-get install php