Skip to content

Instantly share code, notes, and snippets.

{
"php.validate.executablePath": "E:/xampp/php",
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"editor.fontFamily": "Monaco",
"editor.fontLigatures": true,
"editor.smoothScrolling": true,
"emmet.triggerExpansionOnTab": true,
"colorize.include": ["**.scheme.txt"],
"workbench.statusBar.visible": true,
@zaynali53
zaynali53 / index.html
Created April 17, 2022 11:53
Autocomplete
<input id="autocomplete">
@zaynali53
zaynali53 / name.bff
Created November 24, 2021 17:21
Brainfuck Example
++++++++
[
>++++++++
>+++++++++++
>++++++++++++
>++++
<<<<-
]
>>
++.
@zaynali53
zaynali53 / main.cpp
Last active October 20, 2021 13:14
CPP - Doubly Linked List
#include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
Node* prev;
};
@zaynali53
zaynali53 / index.php
Last active August 1, 2021 07:17
Flat array to Multi-level Tree
<?php
$data = [
[
'id' => 1,
'name' => 'A',
'parent_id' => null,
],
[
'id' => 2,
@zaynali53
zaynali53 / nav-menu.css
Last active May 3, 2021 16:32
Wordpress Basic Nav Menu (Multi Level)
/* Reset list styles */
.nav-menu, .nav-menu ul {
padding: 0;
z-index: 99999;
list-style: none;
}
/* Used flex to remove list item gaps */
.nav-menu {
display: flex;
}
@zaynali53
zaynali53 / functions.php
Last active June 14, 2021 18:04
Bootstrap Nav walker class for wp_nav_menu
<?php
class Bootstrap_Nav_Walker extends Walker_Nav_Menu {
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
$active = in_array( 'current-menu-item', $item->classes ) ? 'active' : '';
if ( in_array( 'menu-item-has-children', $item->classes ) ) {
$output .= "
<li class='nav-item dropdown'>
@zaynali53
zaynali53 / functions.php
Created April 26, 2021 11:18
Enqueue assets in a WordPress Theme
<?php
function enqueue_assets() {
// If using a child theme, auto-load the parent theme style.
if ( is_child_theme() ) {
wp_enqueue_style( 'parent-main', get_template_directory_uri() . '/style.css' );
}
// Always load active theme's style.css
// Returns Given Length Fibonacci Sequence (Array)
// Loop
function fibonacci(length) {
let n1 = 0, n2 = 1, next, sequence = []
for (let i = 1; i <= length; i++) {
sequence.push(n1)
next = n1 + n2
n1 = n2
@zaynali53
zaynali53 / styles.less
Last active June 18, 2017 13:21
Atom editor stylesheet
@fontFamily: "Operator Mono";
@fontFamily2: "flottflott";
@fontFamily3: "segoe ui";
atom-text-editor {
font-family: @fontFamily;
font-size: 17px;
.syntax--entity.syntax--other.syntax--attribute-name.syntax--html,