Skip to content

Instantly share code, notes, and snippets.

View jbenner-radham's full-sized avatar

James Benner jbenner-radham

View GitHub Profile
@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

@Myndex
Myndex / GitHubFlavoredMarkdown.md
Last active July 4, 2024 21:06 — forked from joshuapekera/markdown
GitHub Flavored Markdown Cheat Sheet
@sindresorhus
sindresorhus / esm-package.md
Last active July 29, 2024 13:06
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.
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 29, 2024 03:14
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@anukmd
anukmd / PY0101EN-2-2-Lists.ipynb
Created January 10, 2020 22:19
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mcandre
mcandre / dump-certs.sh
Created January 10, 2020 22:10
Dump a website's certificate chain
openssl s_client -host google.com -port 443 -prexit -showcerts
@mahyahemmat
mahyahemmat / PY0101EN-2-4-Sets.ipynb
Created January 10, 2020 21:54
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rust-play
rust-play / playground.rs
Created January 10, 2020 21:54
Code shared from the Rust Playground
use core::iter::once;
fn main() {
println!("{:?}", fmap(|x| x + 1, 1..100000));
}
fn fmap<A, B>(f: impl Fn(A) -> B, mut foo: impl Iterator<Item=A>) -> Vec<B> {
match foo.next() {
Some(x) => once(f(x)).chain(fmap(f, foo)).collect(),
None => Vec::new()
@rust-play
rust-play / playground.rs
Created January 10, 2020 21:53
Code shared from the Rust Playground
use core::iter::once;
fn main() {
println!("{:?}", fmap(|x| x + 1, 1..100000));
}
fn fmap<A, B>(f: impl Fn(A) -> B, mut foo: impl Iterator<Item=A>) -> Vec<B> {
match foo.next() {
Some(x) => once(f(x)).chain(fmap(f, foo)).collect(),
None => Vec::new()
@ksemel
ksemel / diffmerge.sh
Created January 10, 2020 21:50
Bash: Check for diffs, and only open the merge tool if diffs are found.
#!/bin/bash
#
# Check for diffs, and only open the merge tool if diffs are found.
#
dir=$FIRSTDIRECTORY
dir2=$SECONDDIRECTORY
cd "$dir"