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
var read_time = function(text){ | |
var minutes = Math.floor(text.split(' ').length / 200 ) | |
if(minutes === 0) minutes = 1 | |
return minutes + ' min read' | |
} |
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
<font color="red">Red, anyone?</font> | |
<font color=”red”>Red, anyone?</font> |
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
window.onbeforeunload = function() { | |
return 'You will lose all changes if you leave this page.'; | |
}; |
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 | |
$input = "1600 Amphitheatre Parkway, Mountain View, CA"; | |
$request = array(); | |
$request['url'] = "http://maps.googleapis.com/maps/api/geocode/json?address="; | |
$request['address'] = urlencode($input); | |
$request['sensor'] = "&sensor=true"; | |
print "<pre>"; print @file_get_contents(join('',$request)); |
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() { | |
// Localize jQuery variable | |
var jQuery; | |
/******** Load jQuery if not present *********/ | |
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.4.2') { | |
var script_tag = document.createElement('script'); | |
script_tag.setAttribute("type","text/javascript"); | |
script_tag.setAttribute("src", |
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 | |
function read_time($text){ | |
$words = str_word_count(strip_tags($text)); | |
$min = floor($words / 200); | |
if($min === 0) return '1 min read'; | |
return $min . 'min read'; | |
} |
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 | |
$result = @file_get_contents("http://www.google.com/ig/calculator?hl=en&q=100GBP=?PLN"); | |
var_dump($result); |
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 | |
$primes = array(); | |
for ($i = 0; $i <= 1000; $i++) { | |
if(isPrime($i) === true) array_push($primes, $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
<?php | |
function pretty($elem, $class, $func_name) { | |
echo '<'. $elem.' class="' . $class . '">'; | |
call_user_func($func_name); | |
echo '</'.$elem.'>'; | |
} | |
function main_page() { |
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
/** | |
* Returns a random number between min and max | |
* @param min in range [default 1] | |
* @param max in range [default 100] | |
* @dec decimal places for result [default 2] | |
* | |
* @return float | |
*/ | |
function getRandomArbitary (min, max, dec) { | |