Skip to content

Instantly share code, notes, and snippets.

@khalidx
khalidx / node-typescript-esm.md
Last active July 3, 2024 18:04
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 10:30
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.
@kennethnwc
kennethnwc / .dockerignore
Last active May 18, 2024 05:08
My docker-compose with nextjs and nginx
.next/
node_modules/
Dockerfile
yarn-error.log
.dockerignore
.git
.gitignore
@eduncan911
eduncan911 / plex.sh
Last active July 6, 2023 20:06
Plex + Docker + Updated Chromecast Ultra Config
#!/usr/bin/env bash
#
# Plex's profile for Chromecast is too conservative and only plays 1080p on
# the Chromecast Ultra UHD device (4k).
#
# This script will download an updated Chromecast definition and start a Plex
# docker container, binding a few local paths of where you run this script.
#
# You may want to refer to the Official Plex Docker repository and read the
# README text: https://github.com/plexinc/pms-docker
@nicolasdao
nicolasdao / webpack.md
Last active June 22, 2024 02:56
Basic damn Webpack config for simple transpilation ES6 to ES5

Install

npm install -D acorn babel-loader @babel/core @babel/preset-env babel-polyfill webpack webpack-cli uglifyjs-webpack-plugin --save-dev

webpack-cli and acorn are dependencies that you, unfortunately, have to install if you want to run this god damn thing without any obscure warnings or errors.

Build

Configure Webpack

@goyalmohit
goyalmohit / compare-database-using-liquibase
Last active May 19, 2022 16:22
Liquibase command to compare databases
liquibase
--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
--classpath="C:\\Program Files\\Microsoft JDBC Driver 6.0 for SQL Server\\sqljdbc_6.0\\enu\\jre8"
--url="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorksProd;integratedSecurity=false;"
--username=liquibase
--password=liquibase@123
--logLevel=debug
diff
--referenceUrl="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks2017;integratedSecurity=false;"
--referenceUsername=liquibase
@jwill9999
jwill9999 / README.md
Last active September 21, 2019 19:55
asp.net core
@nour-s
nour-s / IQueryableExtensions
Last active January 30, 2020 14:02 — forked from rionmonster/IQueryableExtensions
Resolve the SQL being executed behind the scenes in Entity Framework Core
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Query.Internal;
using Microsoft.EntityFrameworkCore.Storage;
public static class IQueryableExtensions
{
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
@hlaueriksson
hlaueriksson / Examples.cs
Last active November 12, 2023 21:19
PuppeteerSharp Documentation
using System;
using System.Threading.Tasks;
using NUnit.Framework;
namespace PuppeteerSharp.Contrib.Sample
{
public class Examples
{
async Task<IBrowser> Browser()
{