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 is a sub query for pulling data from outside of the loop.. | |
| // However, we need to preserve the original $wp_query if this is inside an existing loop. | |
| // If this is the last query, then you can ditch it. | |
| $temp = $wp_query; | |
| $wp_query = null; | |
| $wp_query = new WP_Query(); | |
| $wp_query->query('your-custom-query'); |
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
| /* Made using Patternify: http://bit.ly/ffY9p6 */ | |
| body { | |
| background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAZ0lEQVQYGXWPAQ7AIAgD3X7hi/wyvMhnuNXkTDUbiRYopVrGGOU8EVHpkd/ljcysQqK11skXovhDbRa32TKMLUPCS5es3c6fsvqo2XYi/PSHpOkIN99I4aicWsLtM2o46fnnRrdG/ABLSeu1eLIkcAAAAABJRU5ErkJggg==); | |
| } |
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 | |
| /* current_category_ID() | |
| * | |
| * Get the currently-being-viewed category's ID. | |
| * | |
| * THE PROBLEM: | |
| * WordPress offers no easy way to get the id of the category that is currently | |
| * being viewd in an index.php. It offers nice conventions to get the title and | |
| * description (within the loop), but I needed this information outside the loop. |
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
| /* Less Framework/Responsive-design-in-general JavaScript Support Idea | |
| * | |
| * THE PROBLEM: | |
| * Ideally, all responsive design would be handled by CSS. In reality, not | |
| * everythingthat we need to do in the implementation of responsive design can | |
| * be handled by CSS. | |
| * | |
| * THE (CURRENTLY BEING INVESTIGATED) SOLUTION: | |
| * Provide an unseen element that contains arbitrary data that aides us in | |
| * determining what to do when the window changes window resizes or |
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
| /* json_storage.js | |
| * @danott | |
| * 26 APR 2011 | |
| * | |
| * Building on a thread from Stack Overflow, override localStorage and sessionStorage's | |
| * getter and setter functions to allow for storing objects and arrays. | |
| * | |
| * Original thread: | |
| * http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage | |
| */ |
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
| curl get.pow.cx/install.sh | sh | |
| # We don't actually want the firewall rule that pow installs | |
| echo "Get rid of those silly firewall rules for port 80." | |
| ports=($(ruby -e'puts $<.read.scan(/fwd .*?,([\d]+).*?dst-port ([\d]+)/)' "/Library/LaunchDaemons/cx.pow.firewall.plist")) | |
| HTTP_PORT=${ports[0]} | |
| DST_PORT=${ports[1]} | |
| RULE=$(sudo ipfw show | (grep ",$HTTP_PORT .* dst-port $DST_PORT in" || true) | cut -f 1 -d " ") | |
| [[ -n "$RULE" ]] && sudo ipfw del "$RULE" | |
| # Unload the firewall plist and remove it. |
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
| #!/usr/bin/env ruby | |
| # Pow Port | |
| # | |
| # Quickly and easily change the port that Pow is running on. This allows | |
| # you too run Apache and Pow side-by-side (on different ports of course). | |
| # | |
| # WARNING: This will OVERWRITE your ~/.powconfig file. If you have custom | |
| # configurations in there, please back it up first. | |
| # |
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 | |
| /* | |
| Origin: http://snipplr.com/view/4912/relative-time/ | |
| Copied here for my reference | |
| */ | |
| function plural($num) { | |
| if ($num != 1) | |
| return "s"; |
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
| alert('hello'); |