Skip to content

Instantly share code, notes, and snippets.

@ccfelix
ccfelix / slug.php
Created December 1, 2021 14:44
PHP: function slug
<?php
/**
* Create a slug to use in a url
* Dependency: php_intl (extension)
*
* @author ClebioFelix
* @param string $text Text to transform
* @param bool $tolower Convert or not to lowercase
* @return string
@ccfelix
ccfelix / post-receive
Last active June 6, 2020 00:06
post-receive
#!/bin/bash
GIT_WORK_TREE=/var/www/sub_temp git checkout -f
changedfiles=( `git diff-tree --no-commit-id --name-only HEAD^ HEAD` )
cd /var/www/sub_temp/
# check if composer has been updated, if so install
# Check if the composer.lock file is present
@ccfelix
ccfelix / laravel_post_receive hook
Created June 5, 2020 23:37 — forked from vool/laravel_post_receive hook
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"