How I created a card game with Svelte

It’s kinda a tradition for me to use my Christmas holidays for a fun little project. Since Svelte became more and more a thing, so I wanted to do try it in practice myself. I also heard that SvelteKit is pretty popular in the community, so I decided to is as a framework. Because I… Continue reading How I created a card game with Svelte

Mach deinen Code prettier

Als Programmier:in entwickelt man mit der Zeit eine eigene Code-“Handschrift”. Benutzt du für Strings einfache Anführungszeichen (‘) oder doppelte (“)? Benutzt du Semikolons? Benutzt du für Einrückungen Tabstopps oder Leerzeichen und wie viele? Innerhalb eines Projekts ist es auf jeden Fall angenehm, überall die gleiche Formatierung zu haben. Das sorgt für eine bessere Übersicht und… Continue reading Mach deinen Code prettier

If / else statement inside of React Component’s Render method

Sometimes (well, actually pretty often) you have to use conditional statements inside of React Component’s Render methods. You could do it like this: import React from “react”; class MyComponent extends React.Component { render() { return ( {“LGK” == “awesome” ? LGK is awesome! : LGK is not awesome :C } ); } } This works… Continue reading If / else statement inside of React Component’s Render method

Node.js: Check if you are in debug or production mode

Sometimes you have to use other values in a variable when your application is in production as if when you are debugging it. For example you have to use another web service URL. Here is how can do it: var webApiUrl; if (process.env.NODE_ENV === “production”) { // use in production webApiUrl = “http://myapp.online/awesome-app/api”; } else… Continue reading Node.js: Check if you are in debug or production mode