Skip to content

Instantly share code, notes, and snippets.

View francescosalvi's full-sized avatar

Francesco Salvi francescosalvi

View GitHub Profile
If you want to publish ESM/CJS you can update your package.json to use the
"exports" field, and run the tsc compiler twice over the code, once using
--module cjs
```json
{
"name": "dualpackage",
"version": "1.0.0",
"description": "demo of dual esm/cjs package",
@tomhicks
tomhicks / plink-plonk.js
Last active December 4, 2025 03:23
Listen to your web pages
@Ryanb58
Ryanb58 / install.md
Last active July 23, 2025 14:27
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@hagemann
hagemann / database.js
Last active July 12, 2025 22:06
Promisified MySQL middleware for Node.js
const util = require('util')
const mysql = require('mysql')
const pool = mysql.createPool({
connectionLimit: 10,
host: 'localhost',
user: 'root',
password: 'password',
database: 'my_database'
})
@rdapaz
rdapaz / win32com.client.py
Last active May 8, 2025 08:47
Fix for module win32com.gen_py has no attribute 'CLSIDToPackageMap'
# If errors are found, do this
# clear contents of C:\Users\<username>\AppData\Local\Temp\gen_py
# that should fix it, to test it type
import win32com.client
app = win32com.client.gencache.EnsureDispatch('Word.Application')
app.Visible = True
@shortjared
shortjared / list.txt
Last active December 2, 2025 11:10
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@justsml
justsml / fetch-api-examples.md
Last active April 22, 2025 13:44
JavaScript Fetch API Examples
@qaharmdz
qaharmdz / gist:48b573967da8e5441765111401ef205b
Created July 6, 2017 09:17
PHP array pair: odd as key, even as value
// Based on https://www.sitepoint.com/community/t/reorganizing-an-array-odd-entries-as-key-even-entries-as-value/95548/2
function array_pair($items)
{
$results = array();
foreach (array_chunk($items, 2) as $pair) {
list($key, $value) = $pair+[null,null]; // fix list() issue
$results[$key] = $value;
}
@dleonard00
dleonard00 / explode-opvn.sh
Created January 15, 2017 07:31
extract the certificate and key from an .ovpn file
#!/bin/bash
# This script will extract the certificate and key from an .ovpn file
# into their own files, which makes it possible to use them to configure
# the VPN using Ubuntu's network manager
# Usage example:
# >> ovpnconvert username.dev.ovpn
# You can keep following these instructions here:
@joepie91
joepie91 / vpn.md
Last active December 15, 2025 03:26
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.