$this->uri->segment(n); // n=1 for controller, n=2 for method, etc
This file contains hidden or 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" | |
| # convert users public repos into private | |
| gh repo list --source --visibility public --limit 5000 --json nameWithOwner | jq -r '.[].nameWithOwner' | xargs -I % sh -c 'echo "Converting % to private..."; gh repo edit % --visibility private --accept-visibility-change-consequences' | |
| # convert users public repos into private (legacy gh-cli version) | |
| gh api user/repos --paginate | jq -r '.[] | select(.fork == false and .private == false) | .full_name' | xargs -I % sh -c 'echo "Converting % to private..."; gh repo edit % --visibility private --accept-visibility-change-consequences' |
This file contains hidden or 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 hidden or 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 hidden or 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'); |