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 | |
| ob_start(); | |
| if(!function_exists("do_action")) : | |
| header('content-type: text/xml'); | |
| include_once('../../../../wp-config.php'); | |
| endif; | |
| $xml = array(); | |
| $xml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; | |
| $xml[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"; | |
| $xml[] = "<lista>"; |
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
| // console | |
| Handlebars.registerHelper("debug", function(optionalValue) { | |
| console.log("Current Context"); | |
| console.log("===================="); | |
| console.log(this); | |
| if (optionalValue) { | |
| console.log("Value"); | |
| console.log("===================="); | |
| console.log(optionalValue); |
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
| window.onload = function() { | |
| var links = document.getElementsByTagName('a'), len = links.length; | |
| for(var i = 0; i < len; i++) { | |
| links[i].addEventListener('click', function(event) { | |
| if (this.target === '_blank') { | |
| window.open(this.url, '_blank'); | |
| } | |
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
| // return width - padding | |
| @function calc-width($width, $padding) { | |
| @return $width - $padding | |
| } | |
| // return height - padding | |
| @function calc-height($height, $padding) { | |
| @return $height - $padding | |
| } |
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
| # ENVIRONMENT | |
| #export JAVA_HOME=~/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home | |
| export ANT_HOME=/Users/$USER/Development/apache-ant-1.8.2 | |
| export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home | |
| export JBOSS_HOME=/Users/$USER/Development/jboss-5.1.0.GA | |
| export JETTY_HOME=/Users/$USER/Development/jetty-6.1.3 | |
| export JRUBY_HOME=/Library/Frameworks/JRuby.framework/Versions/Current | |
| export M2_HOME=/Users/$USER/Development/apache-maven-3.0.3 | |
| export MACPORTS=/opt/local/bin:/opt/local/sbin | |
| export MONGO_HOME=/usr/local/mongodb |
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
| /* update table wp_post_meta */ | |
| UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '/wp/', '/') WHERE 1=1; | |
| /* update table wp_post */ | |
| UPDATE wp_posts SET post_content = REPLACE(post_content, '/wp/', '/') WHERE 1=1 | |
| UPDATE wp_posts SET guid = REPLACE(guid, '/wp/', '/') WHERE 1=1 |
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
| mysql -u root -p #init mysql | |
| create database dbname; #create database | |
| use dbname; #use database | |
| source pathofsqlfile.sql #import dump sql | |
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
| #INSTALLING MYSQL | |
| sudo apt-get update | |
| sudo apt-get dist-upgrade | |
| sudo apt-get install mysql-server mysql-client | |
| #optional | |
| sudo mysqladmin -u root -h localhost password 'mypassword' | |
| sudo mysqladmin -u root -h myhostname password 'mypassword' | |
| #install php library |
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
| import flash.external.ExternalInterface; | |
| ExternalInterface.addCallback("javascriptFNC", flashFNC); | |
| function flashFNC():void{ | |
| //actions | |
| } | |
| ---------------------------------------------------------- | |
| ## javascript |
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 (is_home () ) { | |
| bloginfo('name'); | |
| } elseif ( is_category() ) { | |
| single_cat_title(); echo ' - ' ; bloginfo('name'); | |
| } elseif (is_single() ) { | |
| single_post_title(); | |
| } elseif (is_page() ) { | |
| bloginfo('name'); echo ': '; single_post_title(); | |
| } else { | |
| wp_title('',true); |