Skip to content

Instantly share code, notes, and snippets.

View zetxek's full-sized avatar
😎
Time off work - time to play with pet projects (and AI 🤖)

Adrián Moreno Peña zetxek

😎
Time off work - time to play with pet projects (and AI 🤖)
View GitHub Profile
@noraj
noraj / gulp-cjs-to-esm.md
Last active February 28, 2025 16:04
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 April 7, 2025 16:23
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.

#Effective Communication


Prepare the conversation.

  • Why are we having this conversation?
    Your time is valuable, other people's time is valuable. If you need to use this time, the least you can do is to prepare it. Things such as "what do you want to achieve?", "What info you need to give?", and all following...
  • What do you expect from the meeting?
    How many times do you go to a meeting without thinking what's the outcome you want from it?
  • Try to understand the audience.:
  • How can I get to my audience better?.
@sshymko
sshymko / install_mysql_client.sh
Last active December 17, 2024 21:17
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client
@AaronV
AaronV / PassthroughService.js
Created January 26, 2017 17:20
Demandware Controller -> Pipeline passthrough service
/*
Run with:
PassthroughService.pass(exports, "MyPipelineName", [
"myPipelineMethod",
...
]);
*/
var Pipeline = require('dw/system/Pipeline');
SELECT TRIM(pgdb.datname) AS DATABASE,
TRIM(pgn.nspname) AS SCHEMA,
TRIM(a.name) AS TABLE,
b.mbytes,
a.rows
FROM (SELECT db_id,
id,
name,
SUM(ROWS) AS ROWS
FROM stv_tbl_perm a
@elsonrodriguez
elsonrodriguez / fast-sc.yaml
Last active February 12, 2019 03:20
Superset/Caravel on Kubernetes
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: fast
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd
@mrosati84
mrosati84 / settings.php
Created November 22, 2016 15:21
Drupal 8 reverse proxy settings
<?php
/**
* Reverse Proxy Configuration:
*
* Reverse proxy servers are often used to enhance the performance
* of heavily visited sites and may also provide other site caching,
* security, or encryption benefits. In an environment where Drupal
* is behind a reverse proxy, the real IP address of the client should
* be determined such that the correct client IP address is available
@am-MongoDB
am-MongoDB / logging_producer.js
Last active February 13, 2017 16:13
Kinesis producer (Node.js)
'use strict';
var util = require('util');
var logger = require('../../util/logger');
function loggingProducer(kinesis, config) {
var log = logger().getLogger('loggingProducer');
function _createStreamIfNotCreated(callback) {
var params = {
@SirDarcanos
SirDarcanos / functions.php
Last active December 8, 2023 14:17
How to Show the Product Short Description on the Shop Page
<?php
add_action( 'woocommerce_after_shop_loop_item', 'woo_show_excerpt_shop_page', 6 );
function woo_show_excerpt_shop_page() {
global $product;
echo '<p class="short-description">' . $product->post->post_excerpt . '</p>';
}