$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" | |
# count total commits in a repo | |
git rev-list --all --count | |
# edit all commit messages | |
git rebase -i --root |
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'); |