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
| function dump() | |
| { | |
| $args = func_get_args(); | |
| echo "\n<pre style=\"border:1px solid #ccc;padding:10px;margin:10px;font:14px courier;background:whitesmoke;display:block;border-radius:4px;\">\n"; | |
| $trace = debug_backtrace(false); | |
| $offset = (@$trace[2]['function'] === 'dump_d') ? 2 : 0; | |
| echo "<span style=\"color:red\">" . @$trace[1+$offset]['class'] . "</span>:" . |
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
| function makeLink ($uri, $e = TRUE) { | |
| static $url = NULL; | |
| static $path = NULL; | |
| static $qs = NULL; | |
| if ( ! $url) { | |
| $protocol = 'http'; | |
| if ( ! empty($_SERVER['HTTPS']) && | |
| $_SERVER['HTTPS'] !== 'off' || |
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
| function bgDate ($date) { | |
| $array1 = array( | |
| "Monday","Tuesday","Wednesday","Thursday", | |
| "Friday","Saturday","Sunday" | |
| ); | |
| $array2 = array( | |
| "Понеделник","Вторник","Сряда","Четвъртък", | |
| "Петък","Събота","Неделя" |
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
| <h3>Pages</h3> | |
| <ul><?php wp_list_pages("title_li=" ); ?></ul> | |
| <h3>Feeds</h3> | |
| <ul> | |
| <li><a title="Full content" href="feed:<?php bloginfo('rss2_url'); ?>">Main RSS</a></li> | |
| <li><a title="Comment Feed" href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comment Feed</a></li> | |
| </ul> | |
| <h3>Categories</h3> | |
| <ul><?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0&feed=RSS'); ?></ul> | |
| <h3>All Blog Posts:</h3> |
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
| function betterTags ($args=NULL, $echo=TRUE, $sizes=FALSE) { | |
| if ($args == NULL) $args = 'format=array&echo=0&unit=px'; | |
| if ($sizes == FALSE) $sizes = range(10, 23); | |
| $tags = wp_tag_cloud($args); | |
| if (($c = count($tags)) > 0) { | |
| for ($i=0; $i<$c; $i++) { |
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
| function get_post_images ($id) { | |
| $images = get_children(array( | |
| 'post_parent' => $id, | |
| 'post_type' => 'attachment', | |
| 'post_mime_type' => 'image' | |
| )); | |
| if ( ! $images) return FALSE; |
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
Show hidden characters
| { | |
| "cmd": ["g++ -Wall ${file} -o ${file_base_name} && start ${file_base_name}"], | |
| "working_dir": "${file_path}", | |
| "selector": "source.c++", | |
| "shell": true, | |
| "encoding": "utf8" | |
| } |
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
| function addAppropriateData(selectID) { | |
| // INCETION :D | |
| var selects = { | |
| 'conf-opts-dd-height': { | |
| 'others': ['conf-opts-dd-length', 'conf-opts-dd-depth'], | |
| 'addData': function () { | |
| } | |
| }, |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
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
| function isClosure ($func) { | |
| if ( ! is_object($func)) { | |
| return FALSE; | |
| } | |
| return ($func instanceof Closure); | |
| } |