Skip to content

Instantly share code, notes, and snippets.

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

Jean Wang jeanwang2dev

🏠
Working from home
View GitHub Profile
@noraj
noraj / gulp-cjs-to-esm.md
Last active October 3, 2025 21:44
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 November 11, 2025 10:00
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.
@Mau5Machine
Mau5Machine / docker-compose.yml
Last active July 17, 2025 20:13
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@eklect
eklect / docker-compose-explained.yml
Last active September 28, 2019 11:46
Docker-> Docker Composer YAML File explained
//The Docker Compose Version
version: '3'
//This is a list of the services (containers) that you will be using to run whatever application you have written.
//Let's say you are writing a simple php web app with a database. Then these are the containers that you would use
services:
//This is the name of one of your first container. You can name it whatever you want.
//You will want to name this something memorable as you will use this name to access the box for SSH or other network activity
devbox:
@eklect
eklect / DevBox.DockerFile
Created April 10, 2019 19:52
Docker -> Example Dev Box DockerFile
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y apache2
RUN apt-get install -y php
RUN apt-get install -y php-dev
RUN apt-get install -y php-mysql
RUN apt-get install -y libapache2-mod-php
RUN apt-get install -y php-curl
@jessepearson
jessepearson / storefront-two-columns.css
Last active June 22, 2020 01:34
CSS to add to make Storefront display two columns in mobile views.
ul.products li.product {
width: 46.411765%;
float: left;
margin-right: 5.8823529412%;
}
ul.products li.product:nth-of-type( 2n ) {
margin-right: 0;
}
@aurooba
aurooba / nav_social_walker.php
Last active August 4, 2019 00:22
Social Media Navigation Walker
<?php
/**
* Custom Social Media Nav Walker by Aurooba Ahmed
* This uses Font Awesome and adds in the correct icon by detecting the URL of the menu item.
* You can use this by doing a custom wp_nav_menu query:
* wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new WO_Nav_Social_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'social', 'fallback_cb'=>false ));
*
*/
class WO_Nav_Social_Walker extends Walker_Nav_Menu {
@roscabgdn
roscabgdn / security-tips.php
Last active January 29, 2024 09:06
Advanced WordPress Security Tips
/*
* this code goes in your theme`s functions.php file
*/
add_filter('login_errors',create_function('$a', "return null;"));
define( 'DISALLOW_FILE_EDIT', true );
function no_wordpress_errors(){
return 'Nothing to see here, move along!';
}
@ashblue
ashblue / A-Pen-by-Ash-Blue.markdown
Created December 2, 2013 21:27
A Pen by Ash Blue.