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.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
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
x('4'); | |
function x(i){ | |
if(typeof i === 'undefined'){ | |
console.log('i : undefined'); | |
}else{ | |
console.log('i : ' + i); | |
console.log('typeof ' + typeof i); | |
} | |
} |
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 () { | |
$('#plane').hide().delay(500).fadeIn(1000); | |
}); |
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 resetFunction(){ | |
$('html, body').animate({scrollTop:0}, 1500, 'easeOutQuint'); | |
} |
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
<? | |
// start{ | |
// exec time | |
$start_time = (float) array_sum(explode(' ', microtime())); | |
// } | |
// config file { | |
// developer mode on/off | |
define('DEV_MODE', true); |
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 | |
// sample title | |
$title = "the, *t.ru/e ;h'or']ror} (2)3!@ # $ % ^ & (* )^ ) _+-0(*)*%(&!^"; | |
// find and replace any whitespace characters with underscores | |
$excerpt = preg_replace('/\s/', '_', $title); | |
// find an replace any none alphanumeric or underscore characters with any empty string '' | |
$excerpt = preg_replace('/[^a-zA-Z0-9_]/', '', $excerpt); | |
// while there is a '__' string inside the string, keep replacing the '__' with '_' | |
while (strpos($excerpt, '__') !== false){ |
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 | |
// CONTINUE: | |
// CLASSES & OBJECTS - http://php.net/manual/en/language.oop5.php | |
// BASICS (TUTORIAL) - http://www.php.net/manual/en/language.oop5.basic.php | |
// CONSTRUCTORS - http://www.php.net/manual/en/language.oop5.decon.php | |
// new class | |
class Foo{ | |
// constructor |
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 | |
$temp = array('one', 'two', 'three', 'four'); | |
list($one, $two, $three, $four) = $temp; | |
var_dump($temp); | |
var_dump($one, $two, $three, $four); | |
// RESULTS | |
/* |
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 | |
$a = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); | |
$new_a = array_map('square', $a); | |
var_dump($a, $new_a); | |
function square($temp){ | |
return ($temp * $temp); | |
} |
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 | |
$a = array(); | |
for ($i=0; $i < 3; $i++) { | |
array_push($a, $i); | |
var_dump($a); | |
} | |
for ($i=0; $i < 3; $i++) { | |
array_pop($a); |