Skip to content

Instantly share code, notes, and snippets.

View hanigamal's full-sized avatar
🎯
Focusing at office

Hani Gamal hanigamal

🎯
Focusing at office
View GitHub Profile
@chrisl8888
chrisl8888 / simple-mail-script.php
Created August 4, 2016 02:42
Simple mail test script
<?php
$to = "[email protected]"; // REPLACE
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
@isc30
isc30 / install.bash
Last active January 27, 2021 10:38
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
@johngan
johngan / Errors.md
Last active October 27, 2016 00:17
Laravel 5

Class some controller path does not exist

The API return error like this:

{
  "message": "Class Api\\Controllers\\AuthController does not exist",
  "status_code": 500,
  "debug": {
    "line": 280,
...
@tanner0101
tanner0101 / routes.php
Last active October 26, 2016 23:54
Laravel Benchmark
<?php
use DB;
Route::get('/plaintext', function() {
return 'Hello, world!';
});
Route::get('/json', function() {
return [
@johnantoni
johnantoni / gist:07df65898456ace4307d5bb6cbdc7f51
Last active November 1, 2024 18:33 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@loburets
loburets / TitleComposer.php
Last active July 2, 2017 22:04
laravel titles
<?php
namespace App\Http\ViewComposers;
use Illuminate\View\View;
use App\Http\Requests;
class TitleComposer
{
@vinicius73
vinicius73 / PresentableTrait.php
Last active October 13, 2023 00:13
Laravel Presenter
<?php
namespace App\Support\ViewPresenter;
trait PresentableTrait
{
/**
* View presenter instance.
*
* @var mixed
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@dtomasi
dtomasi / default
Last active February 17, 2025 02:27
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@chrisl8888
chrisl8888 / open-chrome.sh
Last active June 27, 2017 00:24
open chrome and disable web security
#!/usr/bin
open -a Google\ Chrome --args --disable-web-security --user-data-dir