Skip to content

Instantly share code, notes, and snippets.

View zaherg's full-sized avatar
🎯
Focusing

Zaher Ghaibeh zaherg

🎯
Focusing
View GitHub Profile
<?php
use Illuminate\Support\Contracts\ArrayableInterface;
use Illuminate\Support\Contracts\JsonableInterface;
class Excel implements ArrayableInterface, JsonableInterface{
protected $objPHPExcel;
public function __construct($file){
if($file instanceof \SplFileInfo){
$filename = $file->getRealPath();

Symfony Security Checker in Laravel

Artisan command for Sensiolabs Security Checker

Require this project in your composer.json file

"sensiolabs/security-checker": "dev-master"

Add the following line to app/start/artisan.php:

<?php namespace Initr\Services;
use Illuminate\Validation\Factory as LaravelValidator;
abstract class Validator
{
protected $validator;
protected $data = array();
git fetch --all
git reset --hard origin/master
git pull origin master
#!/bin/bash
## Author: Ken Goldfarb <[email protected]>
## https://github.com/kengoldfarb
##
## This script will install Nginx+Pagespeed with PHP-FPM 5.5.x
## It's testsed working on a stock AWS Ubuntu 13.10 image
##
## BONUS: Oh-my-zsh installation included!
@zaherg
zaherg / zsh.md
Last active August 29, 2015 14:12 — forked from tsabat/zsh.md
@zaherg
zaherg / x.bash
Last active August 29, 2015 14:14 — forked from zackkitzmiller/x.bash
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@zaherg
zaherg / download_rethinkdb_for_raspberry_pi_2.sh
Last active October 29, 2015 04:39 — forked from dalanmiller/download_rethinkdb_for_raspberry_pi_2.sh
A quick script to download and compile RethinkDB on Raspberry Pi 2
sudo apt-get install g++ protobuf-compiler libprotobuf-dev libboost-dev curl m4 wget
#At this point make sure you check to see that 2.0.4 is still the most recent version of RethinkDB! http://rethinkdb.com
wget http://download.rethinkdb.com/dist/rethinkdb-latest.tgz
tar xf rethinkdb-latest.tgz
rm rethinkdb-latest.tgz
cd rethinkdb-*
./configure --with-system-malloc --allow-fetch
#Export the proper C++ flags for Raspberry Pi 1/2
@zaherg
zaherg / imagick-3.4.0RC6-PHP7-forge.sh
Created March 3, 2016 15:09 — forked from pascalbaljet/imagick-3.4.0-PHP7-forge.sh
Install Imagick 3.4.0RC6 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget http://pecl.php.net/get/imagick-3.4.0RC6.tgz
tar xvzf imagick-3.4.0RC6.tgz