Skip to content

Instantly share code, notes, and snippets.

View m5lil's full-sized avatar
🏠
Working from home

Mahmoud Ahmed (محمود أحمد) m5lil

🏠
Working from home
View GitHub Profile
@m5lil
m5lil / README.md
Last active June 28, 2021 23:06 — forked from oodavid/README.md
Deploy your site with git #others

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@m5lil
m5lil / gravatar.md
Last active June 29, 2021 00:11
[Gravatar pic] #others #gravatar

https://www.gravatar.com/avatar/' . md5(auth()->user()->email) . '?d=mm'

function gravatar(string $name): string
{
    $gravatarId = md5(strtolower(trim($name)));

    return 'https://gravatar.com/avatar/'.$gravatarId.'?s=240';
}
@m5lil
m5lil / mfupload.md
Created January 14, 2017 18:38
Multi file upload
<form action="upload" id="upload" enctype="multipart/form-data">
    <input type="file" name="file[]" multiple><br />
    <input type="submit">
</form>
<div id="message"></div>
@m5lil
m5lil / hotspot.md
Created January 18, 2017 02:29
Create a wireless Hosted Network in Windows 10 ( Hotspot )
NETSH WLAN set hostednetwork mode=allow ssid=Your_SSID key=Your_Passphrase
NETSH WLAN start hostednetwork

if the last cammand didn't work enable Microsoft Hosted Network Virtual Adapter in 'Device Manager`

@m5lil
m5lil / .bash_aliases.md
Created January 23, 2017 19:52
Some of my aliases for terminial
## get rid of command not found ##
alias cd..='cd ..' 
 
## a quick way to get out of current directory ##
alias ..='cd ..' 
alias ...='cd ../../../' 
alias ....='cd ../../../../' 
alias .....='cd ../../../../' 
alias .4='cd ../../../../' 
@m5lil
m5lil / changlogs.md
Last active December 10, 2019 05:52
laravel snippets,etc...
namespace App\Traits;

use Illuminate\Database\Eloquent\Builder;

trait Multitenantable {

    protected static function bootMultitenantable()
    {
@m5lil
m5lil / loop.md
Created February 15, 2017 06:38
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
@m5lil
m5lil / order.md
Created March 7, 2017 18:00
#sortable #order #draggable #laravel
    Route::post('/menu/order', function()
    {
//        dd(Input::get('item'));
        if(Input::has('item'))
        {
            $i = 0;
            foreach(Input::get('item') as $id)
            {
                $i++;
@m5lil
m5lil / yt.md
Created March 7, 2017 21:27
parse yt id
            $url = Input::get('video');
            $var_v = parse_url( $url, PHP_URL_QUERY );

            if ($var_v) {
              parse_str( $var_v, $q );
              $model->video = $q['v'];
            }

@m5lil
m5lil / webkit-pseudo-elements.md
Created May 18, 2017 16:26 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;