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
// set equal height with 2 tags | |
function set_height(div1, div2){ | |
var height1 = $(div1).height(); | |
var height2 = $(div2).height(); | |
if(height1 > height2){ | |
$(div2).css('min-height',height1); | |
}else{ | |
$(div1).css('min-height',height2); | |
} | |
} |
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
// paging code | |
// Query to count rows. | |
$result = mysql_query("SELECT * FROM Table_Name WHERE Column_Name = '$section'"); | |
$items = 32; // number of items per page. | |
$all = $_GET['a']; //This is the view all param. | |
$num_rows = mysql_num_rows($result); | |
if($all == "all"){ | |
$items = $num_rows; | |
} |
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
@ini_set('log_errors','On'); | |
@ini_set('display_errors','Off'); | |
@ini_set('error_log','/home/example.com/logs/php_error.log'); |
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
// insert dom, does not reflow | |
var box2 = document.getElementById("box2"); | |
box2.insertAdjacentHTML('beforebegin', '<div><p>This gets inserted.</p></div>'); | |
/* | |
beforebegin | |
The HTML would be placed immediately before the element, as a sibling. | |
afterbegin | |
The HTML would be placed inside the element, before its first child. | |
beforeend | |
The HTML would be placed inside the element, after its last child. |
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
## mod rewrite control URI ## | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteCond %{SCRIPT_FILENAME} !-d | |
RewriteCond %{SCRIPT_FILENAME} !-f | |
RewriteRule ^.*$ ./index.php | |
## htaccess block all but listed IP's ## | |
order deny,allow |
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
Array.prototype.unique = function (sort, sortingFunction) { | |
var array = []; | |
for (var i = 0; i < this.length; i++) { | |
if (array.inArray(this[i]) === false) | |
array.push(this[i]); | |
} | |
if (sort === true) { | |
if (typeof sortingFunction === 'function') | |
array.sort(sortingFunction); | |
else |
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
-- remove DW template comments -- | |
<!-- #(.*)--> | |
-- Find all non html5 doc types -- | |
# has not been tested in the wild # | |
<\!DOCTYPE (html|HTML) (.*?\n?) (.*?)> | |
-- Find 4 or more of the same letter or number -- | |
-- like aaaa bbbb or oolllloo -- | |
/([a-z0-9])\1{4,}/i |
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
* { | |
position: relative; | |
} | |
a { | |
transition: all 0.2s ease; | |
} | |
/* vertical align almost any element */ | |
.vertical-align { |
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 this at the start of your .htaccess file ## | |
Options +FollowSymlinks | |
RewriteEngine On | |
## Rewrites all .html pages to php pages with a 301 for seo | |
RewriteEngine on | |
RewriteRule ^(.*)\.html$ $1.php [R=301,L] | |
## Disable the Server Signature ## | |
ServerSignature Off |
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
// Remove ie style sheet and font if not needed for | |
// 2012 WP child theme | |
// source : http://wordpress.org/support/topic/twenty-twelve-submenu-not-working-in-internet-explorer?replies=19 | |
function mytheme_dequeue_styles() { | |
wp_dequeue_style( 'twentytwelve-ie' ); | |
wp_dequeue_style( 'twentytwelve-fonts' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_styles', 11 ); | |
// widgets can use short codes |
OlderNewer