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
<table class="countdown" cellpadding="0" cellspacing="0"> | |
<tbody> | |
<tr> | |
<td>25-12-2017 12:00</td> | |
</tr> | |
</tbody> | |
</table> | |
<script> | |
$('.countdown').each(function(index){ |
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
<configuration> | |
<system.webServer> | |
<security> | |
<requestFiltering> | |
<requestLimits maxAllowedContentLength="120000000" /> | |
</requestFiltering> | |
</security> | |
</system.webServer> | |
</configuration> |
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
// You need to find out the parent menu slug, used when added the submenu: | |
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); | |
// Replace those next | |
function remove_submenu() { | |
remove_submenu_page( '$parent_slug', '$menu_slug' ); | |
} | |
add_action( 'admin_menu', 'remove_submenu', 999 ); |
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
<nav class="navmenu"> | |
<?php | |
$args = array( 'post_type' => 'page', 'posts_per_page' => -1, 'fields' => 'ids', 'meta_query' => array( array( 'key' => '_wp_page_template', 'value' => 'page-gallery.php', 'compare' => '=', ) ), ); | |
$pages_to_exclude = new WP_Query( $args ); | |
wp_page_menu( array( 'before' => '<ul class="sf-menu">', 'sort_column' => 'menu_order, ID', 'menu_class' => 'primary-menu', 'exclude' => implode( ',', $pages_to_exclude->posts ), ) ); | |
?> | |
</nav> |
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 | |
// Add support for cropping default WordPress medium images | |
if(!get_option("medium_crop")) { | |
add_option("medium_crop", "1"); | |
} else { | |
update_option("medium_crop", "1"); | |
} | |
update_option( 'medium_size_w', 200 ); | |
update_option( 'medium_size_h', 300 ); |
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 | |
// Custom font format button | |
add_filter( 'mce_buttons', 'my_mce_buttons' ); | |
function my_mce_buttons( $buttons ) { | |
array_unshift( $buttons, 'styleselect' ); // Add custom format selector | |
$remove = 'formatselect'; if ( ( $key = array_search( $remove, $buttons ) ) !== false ) unset( $buttons[$key] ); // Remove default format selector | |
return $buttons; | |
} | |
// Custom font styles |
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 fibonacci($n) | |
{ | |
//$fib = [0,1] // use this if you don't want to omit '0' | |
$fib = [1,1]; | |
for($i=1;$i<$n;$i++) | |
{ | |
$fib[] = $fib[$i]+$fib[$i-1]; | |
} | |
//print_r($fib); | |
echo $fib[$n]; |
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
const list = [ | |
{ key: 7, val: "amazon" }, | |
{ key: 3, val: "msn" }, | |
{ key: 5, val: "github" }, | |
{ key: 1, val: "google" }, | |
{ key: 4, val: "stackoverflow" }, | |
{ key: 6, val: "jsfiddle" }, | |
{ key: 2, val: "yahoo" }, | |
{ key: 8, val: "ebay" } | |
]; |
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
const list = [ | |
{ key: 7, val: "amazon" }, | |
{ key: 3, val: "msn" }, | |
{ key: 5, val: "github" }, | |
{ key: 1, val: "google" }, | |
{ key: 4, val: "stackoverflow" }, | |
{ key: 6, val: "jsfiddle" }, | |
{ key: 2, val: "yahoo" }, | |
{ key: 8, val: "ebay" } | |
]; |
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 fib(num) { | |
if(num <= 1) { | |
return 1; | |
} else { | |
return fib(num - 1) + fib(num - 2); | |
} | |
} | |
console.log(fib(4)); // 5 | |
console.log(fib(10)); // 89 |