Skip to content

Instantly share code, notes, and snippets.

View jgermade's full-sized avatar
🎨
Working from home

Jesús Germade jgermade

🎨
Working from home
View GitHub Profile
@devops-school
devops-school / smtp-test-1.sh
Last active November 18, 2024 16:14
Bash/Shell Script to test SMTP SES Credentials
#!/bin/bash
# Set the SMTP server name and port number
SMTP_SERVER="email-smtp.ap-south-1.amazonaws.com"
SMTP_PORT="587"
# Set the sender email address and AWS SES username and password
SENDER_EMAIL="[email protected]"
SES_USERNAME="XXXXXXXXXXX"
SES_PASSWORD="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
const resolved = Promise.resolve()
const nextTick = fn => resolved.then(fn)
const _runListeners = (thisArg, args, listeners, runAfter = fn => fn()) => {
listeners?.forEach(listener => runAfter(() => listener.apply(thisArg, args)))
}
export function EventEmitter (context = null) {
const _events = {}
@lesterlo
lesterlo / apple_hidpi_list.md
Last active December 4, 2024 06:27
Apple display HiDPI resolution list

Below table listed the HiDPI resolution on all apple device.

Mac Display Type Air/Pro 13" (Intel) Air/Pro 13" (M1) Pro 16" iMac 21.5" iMac 27" Pro Display XDR
Monitor Size 13 inch 13 inch 16 inch 21.5 inch 27 inch 32 inch
Native Resolution 2560 x 1600 2560 x 1600 3072 x 1920 4096 × 2304 5120 x 2880 6016 x 3384
HiDPI Level 1 1024 x 640 1024 x 640 1152 x 720 1280 x 720 * 1600 x 900 * 1504 x 846 *
HiDPI Level 2 1280 x 800 1280 x 800 1344 x 840 1680 x 945 * 2048 x 1152 * 1920 x 1080 *
HiDPI Level 3 1440 x 900 1440 x 900 1536 x 960 2048 x 1152 2560 x 1440 2560 x 1440 *
HiDPI Level 4 1680 x 1050 1680 x 1050 1792 x 112
function interceptNetworkRequests(ee) {
const open = XMLHttpRequest.prototype.open;
const send = XMLHttpRequest.prototype.send;
const isRegularXHR = open.toString().indexOf('native code') !== -1;
// don't hijack if already hijacked - this will mess up with frameworks like Angular with zones
// we work if we load first there which we can.
if (isRegularXHR) {
@ilbunilcho
ilbunilcho / How to remove Windows paths from WSL path.md
Created November 1, 2018 16:41
How to remove Windows paths from WSL path

after Build 17093

  • can override settings by edit "/etc/wsl.conf"
  • normally this file is not exists at first
$ sudo vi /etc/wsl.conf

[interop]
appendWindowsPath = false
@mrothNET
mrothNET / LetsEncrypt+certbot+UFW+postfix+dovecot.md
Last active March 31, 2025 09:54
Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

This tutorial describes how to install TLS to a mail server consisting of Postfix and/or Dovecot by using Let's Encrypt certificates with automatic renewing and firewall management.

The system used for this tutorial was:

$ lsb_release -idrc
Distributor ID: Ubuntu
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 28, 2025 16:26
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@XerxesNoble
XerxesNoble / animate_values.js
Last active March 9, 2024 13:07
Basic javascript linear value animation that can accept easing functions and provides update & complete callbacks
/**
* @desc Basic linear value animation that can accept simple easing functions and provides update & complete callbacks
* @param {Object} values - Object with numerical values. eg. { value1: 0, value2: 20, someKey: 55 }
* @param {Number} duration - How long (in milliseconds) the animation will be
* @param {Object} options - target values, update callback & complete callback
* @param {Function} [options.onComplete=(values) => values] - Callback that fires once animation is complete
* @param {Function} [options.onUpdate=(values) => values] - Callback that fires when animation frame updates
* @param {Function} [options.ease=(t) => t] - easing method eg. https://gist.github.com/gre/1650294
* @example
*
@gt3
gt3 / customevent-polyfill.js
Last active March 1, 2022 11:50
custom event polyfill for IE 11 (>= 9 really)
// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
;(function() {
if (typeof window.CustomEvent === "function") return false
function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined }
var evt = document.createEvent("CustomEvent")
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)
return evt
}
@clemlatz
clemlatz / self-signed-ssl-certificate.md
Last active January 3, 2025 23:24
Setup a self-signed SSL certificate with Nginx (server and browser)

1. Configure server: Nginx

Create the certificate:

$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

Create a strong Diffie-Hellman group:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048