Skip to content

Instantly share code, notes, and snippets.

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

Nasser Rafie geminorum

🏠
Working from home
View GitHub Profile
@stokesman
stokesman / vite.config.js
Created October 24, 2023 18:56
Rudimentary Vite config that builds with WordPress dependency extraction
import { createHash } from 'crypto'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {
defaultRequestToExternal,
defaultRequestToHandle
} from '@wordpress/dependency-extraction-webpack-plugin/lib/util.js'
import json2php from 'json2php'
import packageMeta from './package.json';
@Gictorbit
Gictorbit / allpersiangirlnames.md
Created May 25, 2023 17:58
all persian girl names

آ

آبانا آباندخت آبگین آبگینه آبنوس آبین آبینه آپام آپاما

@Gictorbit
Gictorbit / allperianboynames.md
Created May 25, 2023 16:44
all persian boy names

آ

آبان آبتين آپتين آتا آتبين آتريداد آتمين آتور آتيلا

@thewebartisan7
thewebartisan7 / valid-attributes.js
Last active May 20, 2025 01:40
All valid HTML attributes by element
/**
* List of valid HTML attributes that will be passed to first node of component or
* to the node with an attribute 'attributes'.
* Generated from https://www.w3.org/TR/html4/index/attributes.html
*
* @see https://jsfiddle.net/1r8czt2h/
*/
module.exports = {
elementAttributes: {
@ichim-david
ichim-david / gulp-cjs-to-esm.md
Created July 27, 2022 18:18 — forked from noraj/gulp-cjs-to-esm.md
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

@sindresorhus
sindresorhus / esm-package.md
Last active July 6, 2025 04:40
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Gictorbit
Gictorbit / iran-nationalcode-location.json
Created May 6, 2020 00:27
json کد شهرستان و استان برای کد ملی فایل
{
"000": {
"province": "-",
"city": "-"
},
"001": {
"province": "تهران",
"city": "تهران مرکزی"
},
"002": {
@joshuabaker
joshuabaker / languages.json
Last active December 6, 2024 02:10
List of languages with ISO 639-1 Alpha-2 codes in JSON.
[
{
"code": "aa",
"name": "Afar",
"native": "Afar"
},
{
"code": "ab",
"name": "Abkhazian",
"native": "Аҧсуа"
@ivankristianto
ivankristianto / devDependencies.js
Created March 4, 2020 08:02
Webpack Config in WordPress
"devDependencies": {
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.4",
"@babel/plugin-syntax-dynamic-import": "^7.2",
"@babel/plugin-transform-runtime": "^7.6.0",
"@babel/polyfill": "^7.6.0",
"@babel/preset-env": "^7.6.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.4.4",
"@babel/traverse": "^7.5.5",
@mahmoud-eskandari
mahmoud-eskandari / validateCard.js
Last active June 22, 2024 19:05
گولنگ و پی اچ پی اعتبار سنجی کارت عابر بانک ایران در جاوا اسکریپت , Iranian bank cards validator function, Javascript Golang php ,تابع تشخیص صحت کارت عابربانک
"use strict";
// By Mahmoud Eskandari @ MIT license
function validateCard(card) {
if (typeof card === 'undefined'
|| card === null
|| card.length !== 16) {
return false;
}
let cardTotal = 0;
for (let i = 0; i < 16; i += 1) {