Skip to content

Instantly share code, notes, and snippets.

View ahmedash95's full-sized avatar

Ahmed Ammar ahmedash95

View GitHub Profile
@ahmedash95
ahmedash95 / README.md
Created February 26, 2020 15:18 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@ahmedash95
ahmedash95 / cli.args.php
Created April 25, 2019 08:31 — forked from jadb/cli.args.php
Parse PHP CLI arguments
http://pwfisher.com/nucleus/index.php?itemid=45
This command line option parser supports any combination of three types of options (switches, flags and arguments) and returns a simple array.
<?php
/**
* CommandLine class
*
* @package Framework
*/
/**
@ahmedash95
ahmedash95 / pluralsight-dl.sh
Created December 14, 2017 01:09 — forked from melkopisi/pluralsight-dl.sh
download lists from pluralsight using youtube-dl
#!/bin/bash
echo "enter username : "
read username
echo "enter password: "
read -s password
echo "enter course: "
read course
@ahmedash95
ahmedash95 / golang-nuts.go
Created November 27, 2017 18:37 — forked from ryanfitz/golang-nuts.go
two ways to call a function every 2 seconds
package main
import (
"fmt"
"time"
)
// Suggestions from golang-nuts
// http://play.golang.org/p/Ctg3_AQisl
<?php
namespace App\Http\Middleware;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Closure;
class checkChangePasswordMiddleware
{
@ahmedash95
ahmedash95 / cors-nginx.conf
Created March 12, 2017 14:54 — forked from alexjs/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
@ahmedash95
ahmedash95 / nginx.conf
Created February 21, 2017 19:59 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@ahmedash95
ahmedash95 / default.conf
Created January 25, 2017 02:12 — forked from cbmd/default.conf
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@ahmedash95
ahmedash95 / phalconphp_php7_ubuntu_16_04.sh
Last active August 1, 2016 23:45 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \