Skip to content

Instantly share code, notes, and snippets.

View ahmedash95's full-sized avatar

Ahmed Ammar ahmedash95

View GitHub Profile
[program:long_script]
command=/usr/local/bin/long.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/long.err.log
stdout_logfile=/var/log/long.out.log

#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

<script>
function addMWebAd() {
var title = "<p style='margin-top: -25px;position: absolute;z-index: 999999;background-color: #f4f4f4;'>FB Ad</p>";
var txt1='<script id="facebook-jssdk" src="https://connect.facebook.net/en_US/sdk/xfbml.ad.js#xfbml=1&version=v2.5&appId=$appID$">'+
'</scr'+'ipt>';
var txt3='<script>'+
'window.fbAsyncInit = function() {'+
'FB.Event.subscribe('+
'\'ad.loaded\','+
'function(placementID) {'+
@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}";
@ahmedash95
ahmedash95 / default
Last active February 20, 2017 23:31
Laravel Nginx Conf
server {
# default server specification
listen 80 default_server;
# site accessible from http://domain_or_ip
server_name _;
# file location
root /var/www/html/my_project/public;
index index.php index.html index.htm;
@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 / PhalconValetDriver.php
Created February 26, 2017 11:06
Phalcon driver for Laravel Valet
<?php
class PhalconValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@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.
#
<?php
class PhalconValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
<?php
namespace App\Http\Middleware;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Closure;
class checkChangePasswordMiddleware
{