Skip to content

Instantly share code, notes, and snippets.

View mkhlil1288's full-sized avatar

Mahmoud Khalil mkhlil1288

View GitHub Profile
@mkhlil1288
mkhlil1288 / gist:850ec7f1db72ceebbfe3bbbe86fc74c6
Last active February 15, 2017 06:25
loop two item in one row
<?php $c = 0; ?>

@foreach($products as $product)
<?php $b = ( ++$c % 2 == 0 ) ? true : false; ?>
@if($b)
<div class="row ">
@endif
	<div class="col-xs-12 col-sm-6 service_2i">
 
@mkhlil1288
mkhlil1288 / nested_json.md
Created February 12, 2017 14:45
Nested Json laravel
        public function getModelsbymake()
        	{
                try{
                    $statusCode = 200;
                    $response = [
                      'make'  => []
                    //   'models'  => []
                    ];
@mkhlil1288
mkhlil1288 / Uninstall.md
Created January 18, 2017 08:32
For Uninstall package
sudo systemctl stop mysql
sudo apt-get remove --purge mysql-server mysql-common -y
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo rm -rf /var/lib/mysql/ sudo rm -rf /etc/mysql/
@mkhlil1288
mkhlil1288 / fix.sh
Created November 22, 2016 22:28
Fixes the permissions for Laravel
#!/bin/bash
# Copyright (c) 2016 Jacob Martin
# MIT license
# Fixes the permissions of the application for secure serving.
# Note that "www-data" is used here; feel free to change this for your own
# web server's username.
# If you don't have permissions to modify files and folders in the first place,
# this script will not work for you until you fix that with:
@mkhlil1288
mkhlil1288 / gravatar.md
Last active November 14, 2016 10:27
Get Gravatar with php
public static function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {
    $url = 'http://www.gravatar.com/avatar/';
    $url .= md5( strtolower( trim( $email ) ) );
    $url .= "?s=$s&d=$d&r=$r";
    if ( $img ) {
        $url = '<img src="' . $url . '"';
        foreach ( $atts as $key => $val )
            $url .= ' ' . $key . '="' . $val . '"';
 $url .= ' /&gt;';
@mkhlil1288
mkhlil1288 / README.md
Created November 9, 2016 11:15 — forked from aronwoost/README.md
Build auto-deploy with php and git(hub) on an EC2 Amazon AMI instance

Kind of continue from the other gist how to install LAMP on an Amazon AMI

##Install git

sudo yum install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI

@mkhlil1288
mkhlil1288 / SetupServer.md
Last active May 19, 2017 02:22
Setup server ( Ubuntu 16 - LEMP - GitHooks - ... )

Setup My Server

sudo apt-get update
sudo apt-get install git
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo apt-get install npm
sudo npm install --global gulp
@mkhlil1288
mkhlil1288 / .vimrc
Created October 11, 2016 00:58 — forked from JeffreyWay/.vimrc
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
You need to first remove the problematic Merge List and then re-create it. Open your terminal and run the following codes:
sudo rm /var/lib/apt/lists/* -vf
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a
sudo apt-get update && sudo apt-get upgrade
@mkhlil1288
mkhlil1288 / install.sh
Created August 11, 2016 12:10 — forked from julien731/install.sh
Ubuntu Config
# Initial system update
sudo apt-get update && sudo apt-get upgrade
# Install system utilities
## TLP
sudo apt-get install tlp tlp-rdw
sudo tlp start
## Sublime Text 2