This file contains 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> | |
<style> | |
* { | |
color: white; | |
} | |
p { | |
color: green; | |
} |
This file contains 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
# Remove Apache variations on URL, best for SEO | |
Options -MultiViews | |
<IfModule mod_dir.c> | |
# Ensure index.php is only allowed as index | |
DirectoryIndex index.php | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
This file contains 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
<IfModule mod_speling.c> | |
CheckSpelling On | |
CheckCaseOnly On | |
</IfModule> |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /test/ | |
# Strip main index.php and query string | |
RewriteCond %{THE_REQUEST} ^GET./+test/+index\.php\? | |
RewriteRule . /test/? [R=301,NE,L] | |
# Strip multiple slashes and query string | |
RewriteCond %{THE_REQUEST} (.*)//(.*) |
This file contains 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 | |
function getMiddle($first, $end, $contents, $file) | |
{ | |
$arrBegin = explode($first, $contents); | |
if (count($arrBegin) != 2) | |
{ | |
echo 'Bad Begin: '.$file; | |
die(); |
This file contains 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
/** | |
* Get the OS from the HTTP_USER_AGENT string | |
* | |
* * @link http://stackoverflow.com/questions/18070154/get-operating-system-info-with-php | |
* | |
* @return string | |
*/ | |
function getOS() | |
{ | |
$user_agent = (isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'NA'); |
This file contains 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 | |
/** | |
* Model for interfacing with a Wordpress backend | |
* | |
* @author Alex Crooks, Si digital http://sidigital.co | |
**/ | |
// Just replace your WordPress index.php content with this code to test. | |
define('APP_PATH', dirname( __FILE__ )); |
This file contains 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
/** | |
* Disable the Visual and Text Editor p and br tag modifications when saving | |
* | |
* When you call the editor, it will automatically add a filter depending | |
* on which editor you have open: | |
* * Text Editor: add_filter('the_editor_content', 'wp_htmledit_pre'); | |
* * Visual Editor: add_filter('the_editor_content', 'wp_richedit_pre'); | |
* | |
* The only way to stop this is to remove the filter because it's applied. | |
* The next call after is do_action( 'media_buttons', $editor_id ); |
This file contains 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" style="overflow: auto; height: 100%;"> | |
<body style="background: #222222; margin: 0; height: 100%;"> | |
<div style="overflow: hidden; height: 100%;"> | |
<img id="background-image" src="https://www.gstatic.com/chat/hangouts/bg/a432eb7bf6eef1cccf7946ca20e5c2c0-NeilKremer.jpg"> | |
</div> | |
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script type="text/javascript"> |
This file contains 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
/* | |
I was able to achieve these speeds on my laptop: Intel Core i7-4500U @ 1.80GHZ | |
2015/08/20 09:28:05 Test 1: 664579 took 47.0074ms | |
2015/08/20 09:28:05 Test 2: 5761455 took 626.9954ms | |
2015/08/20 09:28:13 Test 3: 50847534 took 8.0860009s | |
*/ | |
package main | |
import ( |
OlderNewer