$this->uri->segment(n); // n=1 for controller, n=2 for method, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# alias to edit commit messages without using rebase interactive | |
# example: git reword commithash message | |
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f" | |
# aliases to change a git repo from private to public, and public to private using gh-cli | |
alias gitpublic="gh repo edit --accept-visibility-change-consequences --visibility public" | |
alias gitprivate="gh repo edit --accept-visibility-change-consequences --visibility private" | |
# delete all your repos using gh-cli (please do not run this unless you want to delete all your repos) | |
gh repo list --limit 300 --json url -q '.[].url' | xargs -n1 gh repo delete --yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creates a URL Slug | |
function _url_slug($string) { | |
$string = strtolower(trim($string)); | |
$string = preg_replace('/[^a-z0-9-]/', '-', $string); | |
$string = preg_replace('/-+/', "-", $string); | |
return $string; | |
} | |
// Gets a Unique slug string by checking in the database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This playbook has been removed as it is now very outdated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Config extends CI_Config { | |
public function database() | |
{ | |
if (function_exists('get_instance')) | |
{ | |
$CI =& get_instance(); | |
$query = $CI->db->get('config'); |