# Frizky Kramer β€” Notes (full text) Source: https://frizky.dev Author: Frizky Kramer Generated: 2026-09-13T04:43:33.550Z --- ## How to Be Unhappy URL: https://frizky.dev/blog/how-to-be-unhappy Published: 2023-05-05 Summary: Some wisdom from your boy James Clear on how to be an unhappy fellow. Some wisdom from your boy James Clear - Stay inside all day - Move as little as possible - Spend more than you earn - Take yourself (and life) too seriously - Look for reasons why things won’t work - Always consume, never contribute - Resent the lucky and successful - Never say hello first - Be unreliable --- ## How to Breathe URL: https://frizky.dev/blog/how-to-breathe Published: 2023-05-04 Summary: A short summary aka TLDR from the book Breath by James Nestor. Breath better? TLDR's from Breath by James Nestor - Breathe through your nose, not your mouth. Your mouth is for eating and complaining, not breathing. - Practice breath control. It's like yoga for your lungs. Inhale, exhale, don't pass out. - Stop mouth breathing. Unless you want to wake up with dry mouth and bad breath, like a desert corpse. - Sit up straight with your shoulders back. Look confident, breathe confidently. - Do breathing exercises. - Pay attention to your breathing patterns. - Consider using a breathing device. Or tape the center of your lips together before sleep. - Practice mindfulness. - Practice gratitude. Being thankful is good for your health, and your mom will be proud. --- ## Write less Javascript URL: https://frizky.dev/blog/shorthand-javascript Published: 2023-03-01 Summary: Make your code look cleaner by writing less. You can achieve this by using so-called shorthand Javascript techniques. Make your code look cleaner by writing less. You can achieve this by using so-called shorthand Javascript techniques. I've included a few that I use most frequently. πŸ™ Empty, null & undefined checks Before After This was a major gamechanger for me. Use the OR operator to check if the date is empty, undefined or null before copying its value to the created variable. When it is empty you can state what you would like the value of the variable to be by declaring it after the OR operator. One line if..else statements Before After Write what you would normally write inside the IF parentheses, before the question mark. You can then write right after the question mark what you would like to return if the IF statement was true. Declare the else return value after the colon. Inception alert, you can even do a nested one, here's an example: This statement checks if type equals to Latte, if so, check if isIced is true. If this is the case, isCoffee becomes false because we all know that iced Latte is an abomination. πŸ‘½ I added parentheses to make it more clear but you can write this line without them. Declaring multiple variables Before After Declare the variables in one line, it doesn't matter whether the variables are Strings, Integers or empty. Just make sure to include only the same variable declarations. You can do the same for const and var declarations. Converting Strings into Numbers Before After You can use this technique to convert a String into an Integer or Double. The first line converts a String into an Integer while the second line converts it into a Double. One line Function declaration Before After Use the arrow operator instead of writing long function declarations and parentheses. I use this for functions with simple tasks such as return or print out values to the console. One line forEach statement Before After Use the arrow operator for your forEach statments when you quickly want to quickly manage the values. Initialize object properties Before After Save yourself some time by not typing the variable name 2 times. html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}