- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
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
| // Usage: | |
| // get_id_by_slug('any-page-slug'); | |
| function get_id_by_slug($page_slug) { | |
| $page = get_page_by_path($page_slug); | |
| if ($page) { | |
| return $page->ID; | |
| } else { | |
| return null; | |
| } |
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 | |
| add_action('admin_init', function () { | |
| // Redirect any user trying to access comments page | |
| global $pagenow; | |
| if ($pagenow === 'edit-comments.php') { | |
| wp_redirect(admin_url()); | |
| exit; | |
| } |
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
| // Usage: | |
| // get_id_by_slug('any-page-slug','any-post-type'); | |
| function get_id_by_slug($page_slug, $slug_page_type = 'page') { | |
| $find_page = get_page_by_path($page_slug, OBJECT, $slug_page_type); | |
| if ($find_page) { | |
| return $find_page->ID; | |
| } else { | |
| return null; | |
| } |
All these Gist files are explained on my Open API Specification (fka Swagger Specification) tutorial on API Handyman blog.
This tutorial is composed of several posts, here are the posts links and files used for each one:
- Part 1: Introduction
- Part 2: The basics
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 | |
| /* | |
| |--------------------------------------------------------------------- | |
| | Rename Files | |
| |--------------------------------------------------------------------- | |
| | | |
| | This is a simple script to renames files in the current directory. | |
| | It converts filenames to lowercase, removes non-alphanumeric | |
| | characters and converts spaces to dashes. |
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
| -------- DVR e Mibo Smart Intelbras ------------------------------------------------------- | |
| rtsp://usuário:senha@ip:porta/cam/realmonitor?channel=1&subtype=0 | |
| Ps minha mibo smart im4c só funcionou com esse link: | |
| rtsp://admin:chave de acesso@ip:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif | |
| -------- Luxvision ------------------------------------------------------- | |
| rtsp://ip:porta/user=[usuário]&password=[senha]&channel=1&stream=0.sdp |
OlderNewer