Skip to content

Instantly share code, notes, and snippets.

View emfluenceindia's full-sized avatar
📖
Open to work

Subrata Sarkar emfluenceindia

📖
Open to work
View GitHub Profile
@emfluenceindia
emfluenceindia / es6-class-and-inheritance-example.js
Created November 19, 2018 07:26
ES6 - A basic example of JavaScript class and inheritance
/**
Declaring Person class, its constructor and methods.
This class will be inherited by GetPerson class later to access its properties and methods.
*/
class Person {
constructor(person) {
this.name = person.name;
this.jobTitle = person.jobTitle;
@emfluenceindia
emfluenceindia / es6-map-and-keys-in-a-complex-jsvascript-object.js
Last active November 19, 2018 10:59
ES6 - Simple example of how to use Object.keys and Array.map in a complex JavaScript object
/**
The following example is a simple use case of Object.keys and Array.map functions
to loop through a nested JavScript array with object nested into it.
Steps:
1. Used a map() method on the main array, i.e. examResult
2. Started looping through the mapped object
3. If the loop encounters a JavaScript Object (marks in this case) it applied Object.keys method on it
Structure of examResult array:
@emfluenceindia
emfluenceindia / hall-column-builder.js
Last active February 13, 2019 13:52
Gutenberg Custom Block for adding columns
/**
* Custom Column control
* Reference: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/columns/index.js
*/
import { times } from 'lodash';
import classnames from 'classnames'
import memoize from 'memize';
/**
@emfluenceindia
emfluenceindia / custom-css-textarea-plugin.php
Created June 6, 2025 13:39
A simple plugin to add a section in WordPress dashboard under Appearance for users to add their custom CSS.
<?php
/**
* Plugin Name: Custom CSS Textarea
* Description: Adds a custom textarea in the WordPress admin where users can add site-wide CSS.
* Version: 1.0.0
* Author: Subrata Sarkar
* Author URI: https://profiles.wordpress.org/subrataemfluence/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: custom-css-textarea
@emfluenceindia
emfluenceindia / disable-comments-by-type.php
Last active June 10, 2025 12:31
Allows administrators to disable comments on selected post types (e.g., Pages, custom post types).
<?php
/**
* Plugin Name: Disable Comments By Type
* Description: Allows administrators to disable comments on selected post types (e.g., Pages, custom post types).
* Version: 1.0.1
* Author: Subrata Sarkar
* Author URI: https://profiles.wordpress.org/subrataemfluence/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: disable-comments-by-type
@emfluenceindia
emfluenceindia / wordpress-language-codes.csv
Last active August 5, 2025 04:55 — forked from danielbachhuber/wordpress-language-codes.csv
Language / locale codes used in WordPress
language english_name native_name
af Afrikaans Afrikaans
ar Arabic العربية
ary Moroccan Arabic العربية المغربية
as Assamese অসমীয়া
az Azerbaijani Azərbaycan dili
azb South Azerbaijani گؤنئی آذربایجان
bel Belarusian Беларуская мова
bg_BG Bulgarian Български
bn_BD Bengali (Bangladesh) বাংলা