Skip to content

Instantly share code, notes, and snippets.

if (isChromatic() && document.fonts) {
addDecorator(story => {
const [isLoadingFonts, setIsLoadingFonts] = useState(true);
useEffect(() => {
Promise.all([
document.fonts.load('400 1em Untitled Sans'),
document.fonts.load('italic 400 1em Untitled Sans'),
document.fonts.load('500 1em Untitled Sans'),
document.fonts.load('italic 500 1em Untitled Sans'),
]).then(() => setIsLoadingFonts(false));
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
TypeError: Cannot call method 'map' of undefined
at Object.getTokens (http://localhost:3000/components/angular-ui-calendar/src/calendar.js:46:24)
at Object.Scope.$digest (http://localhost:3000/components/angular/angular.js:7935:38)
at Object.Scope.$apply (http://localhost:3000/components/angular/angular.js:8143:24)
at done (http://localhost:3000/components/angular/angular.js:9170:20)
at completeRequest (http://localhost:3000/components/angular/angular.js:9333:7)
at XMLHttpRequest.xhr.onreadystatechange (http://localhost:3000/components/angular/angular.js:9303:11) angular.js:5754
TypeError: Cannot read property 'length' of undefined
at allEvents (http://localhost:3000/components/angular-ui-calendar/src/calendar.js:123:41)
at Object.getTokens (http://localhost:3000/components/angular-ui-calendar/src/calendar.js:45:57)
function foo() {
'use strict';
var obj = {
foo: 'bar',
};
}