Skip to content

Instantly share code, notes, and snippets.

View benrogmans's full-sized avatar

Ben Rogmans benrogmans

View GitHub Profile
@SantoshSrinivas79
SantoshSrinivas79 / pyrocms-permissions.sh
Last active August 7, 2022 11:11
Fix PyroCMS File & Folder Permissions All-In-One
sudo chmod -R 777 system/cms/cache
sudo chmod -R 777 system/cms/config
sudo chmod -R 777 addons
sudo chmod -R 777 system/cms/cache
sudo chmod -R 777 uploads
sudo chmod -R 666 system/cms/config/config.php
<?php
/**
* This function accepts an array and joins all values in a string separated by
* a comma except the last value which is preceeded by 'and' instead of a comma
*/
function to_sentence( $array = array() ) {
if( empty( $array ) || ! is_array( $array ) ) {
return $array;
}
@jasny
jasny / install-git-hooks
Last active January 2, 2016 22:59
Define git hooks within your repository. Allows defining multiple scripts for one hook.
#!/bin/bash
HOOK_NAMES="applypatch-msg pre-applypatch post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc"
HOOK_DIR=$(git rev-parse --show-toplevel)/.git/hooks
DIR=$(dirname "$0")
for hook in $HOOK_NAMES; do
# If the hook already exists, is executable, and is not a symlink
if [ ! -h "$HOOK_DIR/$hook" -a -x "$HOOK_DIR/$hook" ]; then
mv "$HOOK_DIR/$hook" "$HOOK_DIR/$hook.local"
fi
anonymous
anonymous / Falling-Confetti.markdown
Created May 6, 2014 20:39
A Pen by Kevin Granger.