Skip to content

Instantly share code, notes, and snippets.

logmojis

A collection of useful emojis for logging and debugging. Cheerio 🙃.

status

✔️ success, done
failure, error
@sindresorhus
sindresorhus / esm-package.md
Last active June 1, 2024 19:35
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.
@eldadfux
eldadfux / .env
Last active June 29, 2022 05:24
Appwrite 0.14 - Stack
_APP_ENV=production
_APP_LOCALE=en
_APP_OPTIONS_ABUSE=enabled
_APP_OPTIONS_FORCE_HTTPS=disabled
_APP_OPENSSL_KEY_V1=your-secret-key
_APP_DOMAIN=localhost
_APP_DOMAIN_TARGET=localhost
_APP_CONSOLE_WHITELIST_ROOT=enabled
_APP_CONSOLE_WHITELIST_EMAILS=
_APP_CONSOLE_WHITELIST_IPS=
@andywer
andywer / _readme.md
Last active March 7, 2024 05:52
React - Functional error boundaries

React - Functional error boundaries

Thanks to React hooks you have now happily turned all your classes into functional components.

Wait, all your components? Not quite. There is one thing that can still only be implemented using classes: Error boundaries.

There is just no functional equivalent for componentDidCatch and deriveStateFromError yet.

Proposed solution

@Glorfindel83
Glorfindel83 / broken-image-repairer.md
Last active August 19, 2023 14:08
Broken Image Repairer

Broken Image Repairer

What is the problem?

A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like

alt text http://example.com/image.png

instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).

@dentechy
dentechy / WSL-ssh-server.md
Last active June 1, 2024 14:48
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 1, 2024 19:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

const serialize = uri => decodeURIComponent(uri).split('&').map(uri => ({ [uri.split('=')[0]]: uri.split('=')[1] })).reduce((a,b) => Object.assign(a,b))
console.log(serialize("_id%3D58c43d995cb9191a2f676b25%26index%3D0%26guid%3D798ebd68-22d5-4465-9d34-d4717891901d%26isActive%3Dfalse%26balance%3D%242%2C569.51%26picture%3Dhttp%3A%2F%2Fplacehold.it%2F32x32%26age%3D33%26eyeColor%3Dgreen%26name%3DDesiree%20Cervantes%26gender%3Dfemale%26company%3DSYNKGEN%26email%3Ddesireecervantes%40synkgen.com%26phone%3D%2B1%20(975)%20536-2019%26address%3D855%20Hendrickson%20Street%2C%20Libertytown%2C%20Marshall%20Islands%2C%205292%26about%3DElit%20anim%20occaecat%20proident%20consectetur%20veniam%20et%20deserunt%20irure.%20Sint%20aliquip%20fugiat%20aute%20tempor%20veniam%20eu%20duis%20mollit%20eiusmod%20aliquip%20ipsum%20enim%20do%20in.%20Pariatur%20nisi%20proident%20commodo%20duis%20nisi%20id%20ut%20commodo%20aute%20irure.%20Minim%20ut%20tempor%20in%20tempor%20dolor%20ex%20veniam%20fugiat.%20Sint%20cillum%20non%20qui%20elit%20a
@noelboss
noelboss / git-deployment.md
Last active May 16, 2024 20:41
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@parmentf
parmentf / GitCommitEmoji.md
Last active June 2, 2024 01:20
Git Commit message Emoji