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
<button class="ham-button flex flex-row items-center"> | |
<div class="ham-icon relative grid place-content-center w-6 h-5"> | |
<div | |
class="w-6 h-0.5 bg-black | |
before:content-[''] before:absolute before:w-6 before:h-0.5 before:bg-black before:top-0.5 before:left-0 | |
after:content-[''] after:absolute after:w-6 after:h-0.5 after:bg-black after:bottom-0.5 after:left-0 | |
[.active_&]:w-0 [.active_&]:before:rotate-45 [.active_&]:before:top-[9px] [.active_&]:after:-rotate-45 [.active_&]:after:bottom-[9px] | |
transition-all duration-300 before:duration-500 after:duration-500" | |
></div> | |
</div> |
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
<!-- 32x32 favicon.ico file for legacy browsers. --> | |
<link rel="icon" href="/favicon.ico"> | |
<!-- A single SVG icon with light/dark version for modern browsers. --> | |
<link rel="icon" href="/icon.svg" type="image/svg+xml"> | |
<!-- 180×180 PNG image for Apple devices. --> | |
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> | |
<!-- Web app manifest with 192×192 and 512×512 PNG icons for Android devices. --> |
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 |
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 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
<?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
<?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
<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
// 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 ); |
NewerOlder