Skip to content

Instantly share code, notes, and snippets.

@joshbeitelspacher
joshbeitelspacher / post-receive
Created March 14, 2011 05:06
A Git post-receive hook for deploying files from a branch to a configurable location after every push.
#!/bin/bash
#
# A Git post-receive hook to deploy content from a Git repository on every
# push into a repository. The branches that should be automatically deployed
# must be listed in the config file of the Git repository. The simplest possible
# configuration is shown below:
#
# [deploy "refs/heads/master"]
# directory = /var/www/site
#
@aldibier
aldibier / How to add a user to www-data (Ubuntu)
Last active November 24, 2022 13:06
How to add a user to www-data (Ubuntu)
Add a new user to the www-data group
In this example, add a new user called vivek to the www-data group, enter:
sudo useradd -g www-data vivek
### set the password for vivek user ###
sudo passwd vivek
@joyrexus
joyrexus / README.md
Last active June 19, 2024 09:35 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@lemiorhan
lemiorhan / post-receive
Last active February 8, 2023 10:06
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
@jroquejr
jroquejr / gist:9875621
Last active April 9, 2019 02:12
WordPress - Remover acentos dos nomes de imagens no upload
<?php
// remove_accents: https://codex.wordpress.org/Function_Reference/remove_accents
add_filter('sanitize_file_name', 'sa_sanitize_spanish_chars', 10);
function sa_sanitize_spanish_chars ($filename) {
return remove_accents( $filename );
}
@vool
vool / laravel_post_receive hook
Last active May 5, 2022 22:39
Post receive hook for Laravel website deploy
#!/bin/bash
echo "********************"
echo "Post receive hook: Updating website"
echo "********************"
#set the git repo dir
GIT_REPO_DIR=~/git/<repo>.git
echo "The git repo dir is $GIT_REPO_DIR"
@gigorok
gigorok / gist:5ca39384635113495796
Created July 4, 2014 13:59
php interactive shell with loaded composer dependencies
php -a -d auto_prepend_file=./vendor/autoload.php
@Braunson
Braunson / cashier.php
Created December 3, 2014 23:44
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@mAAdhaTTah
mAAdhaTTah / composer.json
Last active April 30, 2019 18:36
CMB2 as Composer Library
{
"require": {
"php": ">=5.3.0",
"composer/installers": "v1.0.12",
"webdevstudios/cmb2": "dev-master",
},
"autoload": {
"files": ["vendor/cmb2/init.php"]
},
"extra": {