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
function randomIntFromInterval(min,max){ | |
return Math.floor(Math.random()*(max-min+1)+min); | |
} |
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 | |
$items = array(); | |
$items[] = array( | |
'attr1' => 'value1', | |
'attr2' => 'value2' | |
); | |
foreach ($items as $item) : | |
echo $item['attr1']; |
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 | |
/* | |
Author: Monteiro, Bruno | |
E-mail: [email protected] | |
*/ | |
// Simple cURL settings to retrive all data from the submitted URL | |
function page_status_checker( $url ) { | |
$user_agent='Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0'; |
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 | |
add_filter( 'the_content', 'img_p_class_content_filter', 20); | |
function img_p_class_content_filter($content) { | |
$content = preg_replace("/(<p[^>]*)(\>.*)(\<img.*)(<\/p>)/im", "\$1 class='content-img-wrap'\$2\$3\$4", $content); | |
return $content; | |
} |
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
;(function ($) { | |
console.log('your-code'); | |
})(jQuery); |
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
function between(x, min, max) { | |
return x >= min && x <= max; | |
} |
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
$(document).ready(function(){ | |
var today = new Date(); | |
var day = today.getDate(); | |
var month = today.getMonth()+1; //January is 0! | |
var year = today.getFullYear(); | |
if(day < 10) { | |
day = '0' + day | |
} |
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 | |
/* | |
Template Name: List | |
*/ | |
?> | |
<style> | |
td, tr{ | |
border: 1px solid grey; | |
padding: 10px; |
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
.transition (@transition) { | |
-webkit-transition: @transition; | |
-moz-transition: @transition; | |
-ms-transition: @transition; | |
-o-transition: @transition; | |
} |
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
$(window).scroll(function () { | |
if ($(this).scrollTop() > 100) { | |
... | |
} else { | |
... | |
} | |
}); |
NewerOlder