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 | |
| // get the url | |
| $url = 'http://' . $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]; | |
| // check if there are any slashes inside the url string | |
| if (strpos($url, '/')) { | |
| // split the string in pieces | |
| // use "/" as separator |
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 | |
| /** | |
| * Basic Theme Support usage. Add this to your functions.php file | |
| */ | |
| add_theme_support( 'custom-footer-text' ); | |
| /** | |
| * Elsewhere in your theme... | |
| */ | |
| if( current_theme_supports( 'custom-footer-text' ) ) { |
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 | |
| /** | |
| * Override a 404 | |
| * | |
| * @param string $template If passed, this template will be included and | |
| * the request will be terminated if the inclusion | |
| * was successful | |
| * @param string $type If not a 404, what type of request should this be | |
| * flagged as? Must correspond to one of the |
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 | |
| $countries = array | |
| ( | |
| 'AF' => 'Afghanistan', | |
| 'AX' => 'Aland Islands', | |
| 'AL' => 'Albania', | |
| 'DZ' => 'Algeria', | |
| 'AS' => 'American Samoa', | |
| 'AD' => 'Andorra', |
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 () { | |
| var scriptName = "embed.js"; //name of this script, used to get reference to own tag | |
| var jQuery; //noconflict reference to jquery | |
| var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; | |
| var jqueryVersion = "1.8.3"; | |
| var scriptTag; //reference to the html script tag | |
| /******** Get reference to self (scriptTag) *********/ | |
| var allScripts = document.getElementsByTagName('script'); |
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
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
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
| #Insall Ajenti | |
| apt-get update | |
| wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
| echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
| apt-get update | |
| apt-get install ajenti | |
| service ajenti restart | |
| # Uninstall Apache2 | |
| sudo apt-get autoremove && sudo apt-get remove apache2* |
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
| <? | |
| include '/path/to/viddler/api/'; | |
| $v = new Viddler_V2('API_KEY'); | |
| $auth = $v->viddler_users_auth(array( | |
| 'user' => 'YOUR USERNAME', | |
| 'password' => 'YOUR PASSWORD' | |
| )); | |
| if (! isset($auth['auth']['sessionid'])) { |
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 | |
| // Multi Dimensional Array Search | |
| private function searchForId($id, $array) | |
| { | |
| $value = ''; | |
| foreach ($array as $key => $val) | |
| { | |
| if ($val['hotel_PPID'] == $id) | |
| { |
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
| #!/bin/bash | |
| if [ $1 == '' ]; then | |
| v_valid=false; | |
| #obtain the desired site name | |
| while ! $v_valid; do | |
| read -p "site name:" site_name |