Skip to content

Instantly share code, notes, and snippets.

View gregdeane's full-sized avatar

Greg Deane gregdeane

  • Berlin, Germany
  • 02:38 (UTC +02:00)
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 1, 2024 07:18
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.
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@unr
unr / vscode-settings.json
Created January 3, 2019 21:30
Example of unr's vetur-focused vim-setup in vscode.
{
// editor settings
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.fontSize": 14,
"editor.fontWeight": "500",
"editor.lineHeight": 28,
"editor.letterSpacing": 0,
"editor.fontFamily": "Hack",
"editor.insertSpaces": false,

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@wesbos
wesbos / gist:d7877929def4368cdb8abc12c5d3e38b
Last active September 9, 2020 15:21
"Out Of Office" Filter
Trying to filter "out of office" emails from my inbox as I receive a lot of them when I send a blast.
I need help - what do your "out of office" emails say in your langauge? Comment Below!
## Gmail Filter
("Automatische Antwort" OR "Automatic reply" OR "AutoReply" OR "Out of Office" OR "Xesc Duran" OR "Abwesend" OR "Absence" OR "Absence du bureau" OR "À l'extérieur du bureau" OR "Réponse automatique" OR "Abwesenheitsnotiz" OR "Resposta automática" OR "Automaattinen vastaus" OR "Automatisch antwoord" OR "Afwezig" OR "Afwezigheid" OR "Niet aanwezig" OR "Poza zasięgiem" OR "Na wakacjach" OR "Poza biurem" OR "Automatyczna odpowiedź" OR "Z dala od komputera" OR "Αυτόματη απάντηση" OR "Εκτός γραφείου" OR "na dovolenké" OR "mimo kancelárie" OR "automatická odpověď" OR "Autosvar" OR "Fora do escritório" OR "na dovolené" OR "mimo kancelář")
## List
Automatische Antwort
Automatic reply
@ourmaninamsterdam
ourmaninamsterdam / readme.md
Created September 23, 2015 11:03
Completely uninstall node and npm

Completely uninstall node + npm:

  • go to /usr/local/lib and delete any node and node_modules
  • go to /usr/local/include and delete any node and node_modules directory
  • if you installed with brew install node, then run brew uninstall node in your terminal

Check your Home directory for any local or lib or include folders, and delete any node or node_modules from there go to /usr/local/bin and delete any node executable.

You may need to do the additional instructions as well:

@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@stevemao
stevemao / np.sh
Last active June 15, 2022 00:37 — forked from sindresorhus/np.sh
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;
@pgilad
pgilad / Instructions.md
Last active March 31, 2024 22:30
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example