Skip to content

Instantly share code, notes, and snippets.

View simonkberg's full-sized avatar
:shipit:

Simon Kjellberg simonkberg

:shipit:
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active November 17, 2024 22:07
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.
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@jlengstorf
jlengstorf / *README.md
Last active March 21, 2018 13:36
Create custom git.io short links by adding this helper function to your `.bash_profile`

Create Custom git.io Short Links

Add this helper function to your ~/.bash_profile (or ~/.bashrc, or whatever you use) to create custom short links for your GitHub projects without having to remember the whole cURL command!

Installation

If you use a file other than ~/.bash_profile to configure your terminal, substitute that value in the installation instructions below.

  1. Open your ~/.bash_profile
  2. Copy-paste the gitlink function into it
@sandor-nemeth
sandor-nemeth / PropertyLogger.java
Last active June 6, 2024 08:17
Spring Boot - Log all configuration properties on application startup
package io.github.sandornemeth.spring;
import java.util.Arrays;
import java.util.stream.StreamSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.core.env.AbstractEnvironment;
@joestrong
joestrong / Guide.md
Last active September 16, 2020 21:29
Linux Emoji Support

Install fonts:

  • Bitstream Vera
  • Noto Color Emoji

We set these fonts as the fallbacks, bitstream has the normal characters, Noto has the emoji

We don't want DejaVu to be used as a fallback, as this has overriding emoji

@aviskase
aviskase / Postman.desktop
Last active November 21, 2023 20:56
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active September 15, 2024 18:49
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@louisremi
louisremi / lru.js
Created May 17, 2016 15:38
Last Result Used
function LRU(limit) {
this.limit = limit || 1000;
this.map = new Map();
}
LRU.prototype.has = function(key) {
return this.map.has(key);
}
LRU.prototype.set = function(key, value) {
@taion
taion / async-props-style.js
Last active January 24, 2017 17:14
React Router data fetching
// Define your components like:
class MyComponent extends React.Component {
static fetchData = (params) => {
// return an action here.
};
/* ... */
}
function fetchComponentData(component, store, params) {
@keirlawson
keirlawson / installkeyringhelper.sh
Created February 21, 2016 10:36
Install gnome-keyring git credential helper in Ubuntu
sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
sudo ln -s /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring /usr/lib/git-core/