Skip to content

Instantly share code, notes, and snippets.

View amitbiswas06's full-sized avatar
🏠
Working from home

Amit Biswas amitbiswas06

🏠
Working from home
View GitHub Profile
@bradtraversy
bradtraversy / stack.js
Created May 29, 2020 14:35
Stack data structure
class Stack {
constructor() {
this.items = []
this.count = 0
}
// Add element to top of stack
push(element) {
this.items[this.count] = element
console.log(`${element} added to ${this.count}`)
@akshuvo
akshuvo / WordPress Repeater MetaBox.php
Last active April 18, 2024 09:23
Creating a “repeater meta-box” without a Plugin in WordPress
<?php
add_action('admin_init', 'gpm_add_meta_boxes', 2);
function gpm_add_meta_boxes() {
add_meta_box( 'gpminvoice-group', 'Custom Repeatable', 'Repeatable_meta_box_display', 'page', 'normal', 'default');
}
function Repeatable_meta_box_display() {
global $post;
$gpminvoice_group = get_post_meta($post->ID, 'customdata_group', true);
@fazlurr
fazlurr / WP_Query_Args.php
Last active March 18, 2024 23:14 — forked from billerickson/gist:3698476
WP_Query arguments list
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@cristianstan
cristianstan / Simple Ajax Login Form.php
Last active October 12, 2023 00:09
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>