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 | |
| $bad = array_merge(array_map('chr', range(0,31)), array("<", ">", ":", '"', "/", "\\", "|", "?", "*", " ")); | |
| $result = str_replace($bad, "-", $filename); | |
| ?> |
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
| wget -nc -nH -E -r -k -P /home/you/example.com -np http://example.com/ |
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 | |
| $i=0; | |
| while($c = $db->getNextSet(true)): | |
| print '<li class="'.($i++%2==0 ? 'odd' : 'even').'">Zebras yo!</li>'; | |
| endwhile; | |
| ?> |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>CSS drop-shadows without images</title> | |
| <style> | |
| body { | |
| padding:20px 0 30px; | |
| font:14px/1.5 Arial, sans-serif; | |
| text-align:center; |
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
| # FORCE PORT 80 (insecure / regular traffic) | |
| RewriteEngine On | |
| RewriteCond %{HTTPS} on | |
| RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| ########################################################### | |
| #FORCE PORT 443 && REMOVE WWW. (secure / SSL) | |
| RewriteCond %{SERVER_PORT} 80 | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L] |
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 | |
| /** | |
| * Calculate how much a profile is completed | |
| * | |
| * @param $profile | |
| * @return float|int | |
| */ | |
| function calculate_profile($profile) | |
| { | |
| if ( ! $profile) { |
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
| <script> | |
| function printDiv(divName){ | |
| var printContents = document.getElementById(divName).innerHTML; | |
| var originalContents = document.body.innerHTML; | |
| document.body.innerHTML = printContents; | |
| window.print(); | |
| document.body.innerHTML = originalContents; |
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
| # CSS/JS auto-versioning | |
| RewriteEngine On | |
| RewriteRule ^(.*)\.[\d]{10}\.(css|js)$ $1.$2 [L] |
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 ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
| require_once(BASEPATH . '../application/libraries/PayPal-PHP-SDK/autoload.php'); | |
| use PayPal\Rest\ApiContext; | |
| use PayPal\Auth\OAuthTokenCredential; | |
| use PayPal\Api\Capture; | |
| use PayPal\Api\Authorization; | |
| use PayPal\Api\Amount; | |
| use PayPal\Exception\PayPalConnectionException; |