Skip to content

Instantly share code, notes, and snippets.

@huzaifa-a
huzaifa-a / mariDB.md
Last active July 27, 2020 23:05
Install mariadb-server-10.4 in ubuntu

Step 1: Check that mysql is installed

On Ubuntu 16.04/15.10/15.04:

sudo systemctl status mysql
Step 2: Uninstall MySQL

if you want to install MariaDB on your system first you have to uninstall existing mysql. Follow these steps to uninstall completely existing MySQL from server.

@huzaifa-a
huzaifa-a / laravel-mix.md
Last active October 24, 2023 04:35
Stand alone Laravel mix with Apache2

Configure browserSync

webpack.mix.js

mix.browserSync({
    proxy: 'localhost:8080',
    files: [
        'index.html',
    ]
@huzaifa-a
huzaifa-a / cronjob.md
Last active November 11, 2020 09:21
add cron job to current user by using ssh

SSH

crontab -e

#append entery by using nano editio

* * * * * cd /home/humanitixhs-user/webapps/humanitixhs && php artisan schedule:run >> /dev/null 2>&1

#1 - ^x
@huzaifa-a
huzaifa-a / regex.md
Created September 10, 2020 22:06
remove span tag inside a heading
$match = preg_replace('/(<h(1|2|3|4|5|6)[^>]*>)<span[^>]*>(.*)<\/span>(?=(<\/h(1|2|3|4|5|6)>))/','$1$3', '<h2 id="toc-item-1"><span style="font-weight: 400;">Online Doctor Reviews 2020</hs></span></h2>');
return var_dump($match);
@huzaifa-a
huzaifa-a / newrepo.md
Last active September 17, 2020 14:37
Add existing project to empty repo
git init
git remote add origin https://github.com/computanapps/electrozad-cimmhs.git
git add .
git commit -m "first commit"
git branch -M master
git push -u origin master
@huzaifa-a
huzaifa-a / apache2.md
Last active August 30, 2022 14:08
Setup apache2 on Ubuntu

Apache2

sudo apt-get update
sudo apt-get install apache2

reinstall apache2

sudo apt-get --purge remove apache2*
sudo apt-get --purge autoremove
@huzaifa-a
huzaifa-a / gitignore.md
Created October 9, 2020 12:49
Gitignore not working
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@huzaifa-a
huzaifa-a / docker.md
Last active October 28, 2020 14:52
docker commands
docker mysql

docker pull php
docker pull mysql:5.7

docker images

docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7
@huzaifa-a
huzaifa-a / lazyloading.md
Last active November 6, 2020 13:51
Lazyloading
document.addEventListener("DOMContentLoaded", function() {
  var lazyloadImages;    

  if ("IntersectionObserver" in window) {
    lazyloadImages = document.querySelectorAll(".lazy");
    var imageObserver = new IntersectionObserver(function(entries, observer) {
      entries.forEach(function(entry) {
        if (entry.isIntersecting) {
@huzaifa-a
huzaifa-a / laravelinstall.md
Created November 13, 2020 10:35
Install Laravel form Git Repo

About Senides

How to install

Clone your project
Go to the file using cd

  • composer install