Skip to content

Instantly share code, notes, and snippets.

View Vilsol's full-sized avatar
🎯
Focusing

Vilsol

🎯
Focusing
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 09: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.
@jenschr
jenschr / TTGO_LORA32_BATT_OLED.ino
Created August 10, 2019 14:03
Battery monitor example for the Banggood version of TTGO LoRa32
const uint8_t blue = 2;
const uint8_t vbatPin = 35;
#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
float VBAT; // battery voltage from ESP32 ADC read
SSD1306 display(0x3c, 4, 15);
void setup()
{
Serial.begin(115200);
pinMode(blue, OUTPUT);
@anvk
anvk / psql_useful_stat_queries.sql
Last active April 23, 2024 03:15
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables