May 28Godot 4.0: Block raycast when clicking on UISay I have a feature where I want to spawn an object into the scene at where my mouse clicked on. But I only want this feature to be enabled when a UI button is clicked on, as well as to disable that feature. The technical task I need to…Godot3 min readGodot3 min read
May 27Godot 4.0: Raycast, get component, change variableA little context, I’m working on a game whereby I can select a character and a torus mesh that’s attached to it will be visible (it’s invisible on _ready) — to show that it’s indeed selected. When I select anywhere but the character, the torus will not be visible. In…Godot2 min readGodot2 min read
May 14Express+Typescript: Properly mocking jwt.verify in unit testProblem I was trying to find a way to test a Promise function that’s nested inside jwt.verify which isn’t a non-async function that receives a callback function: const foo = () => { jwt.verify( …Jest2 min readJest2 min read
Jan 2Member-onlyServerless: Setting up a NodeJS Lambda with a Postgres DB hosted in RDSNote: The following is a combination of research done using ChatGPT, StackOverflow, and some experimentation. I’m not an expert in the serverless framework at this time of writing, so I can’t guarantee the effectiveness of the solution provided. At least for now, it works for my current use case. My…Serverless4 min readServerless4 min read
Jan 1Member-onlySveltekit: Setting up a markdown-based blogThere’s probably a better way to do this but I’ve yet to find one for Sveltekit, so here one way I whipped up on my own. — Things to achieve with this project: Write blog post in a markdown doc, and get it rendered in the Sveltekit blog site. Display a list of blog posts in the main page. Setting up the project To start it off, create a Sveltekit project using Vite with TypeScript. Then, create a new directory named…Sveltekit6 min readSveltekit6 min read
Sep 19, 2022Member-onlyFlutter: State Management with flutter_blocAn example to set up a decent state management in Flutter using flutter_bloc. I’ve used two state management libraries for my Flutter projects so far, namely: flutter_bloc and bloc_provider. There’s no particular reason why I chose one over the other, but I do find the former to be easier to…Flutter3 min readFlutter3 min read
Dec 17, 2021Firebase: Troubleshooting “The default Firebase app does not exist…”If like me, you’ve came across one of the following error while trying access FirebaseAdmin’s services, i.e.: “The default Firebase app does not exist…” “_this.ensureApp(…).firestore is not a function” “TypeError: firebaseApp.getOrInitService is not a function” The solution is simply doing the following: Explanation: Using the first element in admin.apps (App[]), instead of the default app (admin.app).Firebase1 min readFirebase1 min read
Sep 21, 2021Svelte+Vite: Access .env variablesIt works a little like React, sans the “process” prefix (which the compiler will tell you it doesn’t exists). First, add a “VITE_” prefix to all your variables in your .env file. Example: VITE_VARIABLE_NAME=value VITE_MODE=development Then, when you want to use it in your Svelte+Vite project, use: import.meta.env.VITE_VARIABLE_NAME import.meta.env.VITE_MODESvelte1 min readSvelte1 min read
Apr 10, 2021Unity — ControlFreak2 Swipe ControlsJust putting a note here because I kept forgetting how to setup swipe controls using ControlFreak2. It’s a really good mobile (and desktop) controls library for Unity, but if you forget how to use it, it won’t exactly be a smooth ride to re-learn its over-complex looking settings. Key bindings To start…3 min read3 min read
Published inCodeX·Mar 12, 2021Member-onlyhygen the sh*t out of your React application — Part 3Part 1: https://medium.com/codex/hygen-the-sh-t-out-of-your-react-application-part-1-6b7cf9442a15 Part 2: https://medium.com/codex/hygen-the-sh-t-out-of-your-react-application-part-2-ce004d9bab45 Yes or No Imagine a scenario where some of the pages in our application are required to display a list of data of the same type in a List or Grid view, kinda like an E-commerce store displaying the list of products. …Hygen8 min readHygen8 min read