Skip to content

Instantly share code, notes, and snippets.

@mylgeorge
mylgeorge / post-receive
Created September 26, 2017 12:41 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@mylgeorge
mylgeorge / ModxController.php
Last active August 18, 2017 13:40
Integrate modX in Laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Input;
use App\ModxModels\ModxContentModel;
use App\Providers\ModxServiceProvider;
class ModxController extends Controller
@mylgeorge
mylgeorge / uri.js
Last active June 16, 2017 13:08 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"