Skip to content

Instantly share code, notes, and snippets.

View melledijkstra's full-sized avatar
🌍
Be a world citizen!

Melle Dijkstra melledijkstra

🌍
Be a world citizen!
View GitHub Profile
@rheajt
rheajt / Code.gs
Last active November 16, 2022 17:04
Google Apps Script file-open dialog boilerplate: https://developers.google.com/apps-script/guides/dialogs#file-open_dialogs
/**
* Creates a custom menu in Google Sheets when the spreadsheet opens.
*/
function onOpen() {
SlidesApp.getUi().createMenu('Picker')
.addItem('Start', 'showPicker')
.addToUi();
}
/**

Using the classnames.bind method

Many people who work with React are familiar with the excellent classnames library. If you aren't familiar, it provides a simple function for gluing classnames together. In web programming in general, there are many times that we need to add or remove multiple classes based on conditional logic. The classnames library makes this easy.

More and more developers are embracing CSS Next and the power of CSS modules. However, when you add CSS modules to your react components, working with classnames gets more difficult. Typically, CSS modules is implemented with class name mangling. Transforming human readable class name strings into unique identifiers helps ensure that every class name in your app is unique.

This means that you can write your component CSS in isolation without worrying about the dreaded class name collisions that have plagued CSS