##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
| // Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
| $('[placeholder]').focus(function() { | |
| var input = $(this); | |
| if (input.val() == input.attr('placeholder')) { | |
| input.val(''); | |
| input.removeClass('placeholder'); | |
| } | |
| }).blur(function() { | |
| var input = $(this); |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| <?php | |
| /** | |
| * Function to get terms only if they have posts by post type | |
| * @param $taxonomy (string) taxonomy name eg: 'post_tag','category'(default),'custom taxonomy' | |
| * @param $post_type (string) post type name eg: 'post'(default),'page','custom post type' | |
| * | |
| * | |
| * Usage: | |
| * list_terms_by_post_type('post_tag','custom_post_type_name'); |
| ############################################# | |
| # Push de la rama actual | |
| git push origin $rama_actual | |
| ############################################# | |
| # Volver a un commit anterior, descartando los cambios | |
| git reset --HARD $SHA1 | |
| ############################################# | |
| # Ver y descargar Ramas remotas |
| function shortcode_empty_paragraph_fix($content) | |
| { | |
| $array = array ( | |
| '<p>[' => '[', | |
| ']</p>' => ']', | |
| ']<br />' => ']' | |
| ); | |
| $content = strtr($content, $array); |
| /* | |
| Make the Facebook Like box responsive (fluid width) | |
| https://developers.facebook.com/docs/reference/plugins/like-box/ | |
| */ | |
| /* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */ | |
| #fb-root { | |
| display: none; | |
| } |
| /* | |
| This code will redirect users from the default PMPro confirmation page to a specific page depending on their level. | |
| Set the confirmation_pages array. Array keys should be membership level ids and the values are the page ids. So array(1=>2) will redirect membership level with id = 1 to the page with id = 2. | |
| */ | |
| function my_pmpro_confirmation_redirect() | |
| { | |
| $confirmation_pages = array(1 => 2); //change this use your membership level ids and page ids | |
| global $pmpro_pages; | |
##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
| /** | |
| * The Twitalinkahashifyer! | |
| * http://www.dustindiaz.com/basement/ify.html | |
| * Eg: | |
| * Ify.clean('your tweet text'); | |
| */ | |
| Ify = { | |
| link: function(tweet) { | |
| return tweet.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g, function(link, m1, m2, m3, m4) { | |
| var http = m2.match(/w/) ? 'http://' : ''; |
| <?xml version="1.0"?> | |
| <layout> | |
| <default> | |
| <!--Root/Default Layouts--> | |
| <reference name="root"> | |
| <!--Appending Block--> | |
| <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> | |
| </reference> | |
| <!--CSS and JS Files--> |