Skip to content

Instantly share code, notes, and snippets.

View rupomkhondaker's full-sized avatar

Rupom Khondaker rupomkhondaker

View GitHub Profile
@rupomkhondaker
rupomkhondaker / pdb-volunteer-dropdown.php
Created July 16, 2018 12:13 — forked from xnau/pdb-volunteer-dropdown.php
Demonstrates a plugin for using database values to populate a dropdown control in Participants database.
<?php
/**
* Plugin Name: PDB Volunteer Dropdown
* Description: load the registered volunteers into a Participants Database form
* dropdown
*/
/*
* sets our function to be called when the pdb-form_element_build_dropdown action
* is triggered by the form
*/
@rupomkhondaker
rupomkhondaker / dl-file.php
Created August 28, 2018 07:02 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@rupomkhondaker
rupomkhondaker / WooCommerce Qty Drop Down 3.4+
Last active August 30, 2018 08:37
This will change normal qty input field to a qty dropdown working with cart and product page all issue fixed tested up 3.4.+
function woocommerce_quantity_input($data = null) {
global $product;
if (!$data) {
$defaults = array(
'input_name' => 'quantity',
'input_value' => '1',
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ),
'min_value' => apply_filters( 'woocommerce_quantity_input_min', '', $product ),
'step' => apply_filters( 'woocommerce_quantity_input_step', '1', $product ),
'style' => apply_filters( 'woocommerce_quantity_style', 'float:left;margin: 4px;', $product )
@rupomkhondaker
rupomkhondaker / Controller.php
Created September 6, 2018 09:21 — forked from gmazzap/Controller.php
WordPress plugin to ease the creation of virtual pages.
<?php
namespace GM\VirtualPages;
/**
* @author Giuseppe Mazzapica <giuseppe.mazzapica@gmail.com>
* @license http://opensource.org/licenses/MIT MIT
*/
class Controller implements ControllerInterface {
private $pages;
@rupomkhondaker
rupomkhondaker / draft.js
Created September 9, 2018 06:06 — forked from landsman/draft.js
automatic convert bootstrap v. 3 to bootstrap v. 4 idea ... more on https://github.com/twbs/bootstrap/blob/v4-dev/docs/4.0/migration.md, http://upgrade-bootstrap.bootply.com/
let gulp = require('gulp'),
replace = require('gulp-batch-replace'),
filesExist = require('files-exist');
gulp.task('bt4', () =>
{
let diff = {
'@media (min-width: $screen-xs-min) and (max-width: $screen-sm-max)': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, xs))',
'@media (min-width: $screen-xs) and (max-width: ($screen-md-min - 1))': '@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, md)-1)',
@rupomkhondaker
rupomkhondaker / wp-admin-select2.php
Created September 12, 2018 12:00 — forked from yanknudtskov/wp-admin-select2.php
Add select2 to all select fields in WordPress Admin
<?php
function enqueue_select2_jquery() {
wp_register_style( 'select2css', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.css', false, '1.0', 'all' );
wp_register_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.4.8/select2.js', array( 'jquery' ), '1.0', true );
wp_enqueue_style( 'select2css' );
wp_enqueue_script( 'select2' );
}
add_action( 'admin_enqueue_scripts', 'enqueue_select2_jquery' );
@rupomkhondaker
rupomkhondaker / my.cnf
Created September 24, 2018 06:20 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on cPanel/WHM servers)
# Optimized my.cnf configuration for MySQL/MariaSQL on cPanel/WHM servers
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated July 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@rupomkhondaker
rupomkhondaker / my.cnf
Created October 11, 2018 11:56 — forked from peerax/my.cnf
mySQL config file for ram 8GB
# my.cnf for TAKIS Server
# BEGIN CONFIG INFO
# DESCR: 8 GB RAM, InnoDB only, ACID, few connections, heavy queries
# TYPE: SYSTEM
# END CONFIG INFO
[client]
port = 7000
socket = /var/lib/mysql/mysql.sock
@rupomkhondaker
rupomkhondaker / exit-popup.js
Created October 21, 2018 05:25
Exit Popup / exit intent popup script enabling you to display a modal before a user leaves your website
/*
* Exit Popup
* Exit Popup enabling you to display a modal before a user leaves your website
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory(require, exports, module);
@rupomkhondaker
rupomkhondaker / template-authors.php
Created February 19, 2020 11:57 — forked from IngmarBoddington/template-authors.php
Example authors page template for multi-author WordPress blogs
<?php
/*
Template Name: Authors
*/
?>
<?php get_header(); ?>
<!-- BEGIN #content-wrap -->
<div id="content-wrap" class="clearfix">