Skip to content

Instantly share code, notes, and snippets.

@maiorano84
maiorano84 / post-receive
Created Aug 23, 2017
Git Branch Deployments Webhook
View post-receive
#!/bin/bash
TARGET="/path/to/root"
GIT_DIR="/path/to/vcs/project.git"
PROD_BRANCH="master"
DEV_BRANCH="development"
while read oldrev newrev ref
do
if [[ $ref = refs/heads/$PROD_BRANCH ]];
then
@maiorano84
maiorano84 / Event.php
Created Jan 21, 2017
Stupid Simple Events
View Event.php
class Event{
protected $name;
protected $callback;
public function __construct($name, Callable $callable){
$this->name = $name;
}
public function fire(array $args = null){
return call_user_func_array($this->callback, $args);
}
}
@maiorano84
maiorano84 / PartialBlurFilter.php
Last active Mar 4, 2017
Partial Blur Filter for Intervention/Image package
View PartialBlurFilter.php
<?php
namespace Maiorano\Services\Filters;
use Intervention\Image\Filters\FilterInterface;
use Intervention\Image\Image;
class PartialBlurFilter implements FilterInterface
{
private $width;
@maiorano84
maiorano84 / ffmpeg.sh
Created Dec 13, 2015
CentOS FFMpeg Installation from Source
View ffmpeg.sh
#!/bin/sh
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
yum -y update
yum -y install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel freetype-devel speex-devel
#YASM
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
@maiorano84
maiorano84 / nginx-restart.bat
Last active Mar 18, 2019
Quick startup for NGINX and PHP on Windows
View nginx-restart.bat
@ECHO OFF
call nginx-stop.bat
call nginx-start.bat
EXIT /b
You can’t perform that action at this time.