Skip to content

Instantly share code, notes, and snippets.

View wmira's full-sized avatar

Warren Mira wmira

View GitHub Profile
//code can be null/undefined so lets fix it
export const formatOrderCode = ( code ) => {
if ( code !== null && code !== undefined ) {
return code.toUpperCase();
}
return null;
}
@wmira
wmira / react_fiber.md
Created February 9, 2017 12:48 — forked from geoffreydhuyvetters/react_fiber.md
What is React Fiber? And how can I try it out today?
@wmira
wmira / Json.kt
Created December 22, 2018 03:22
Kotlin SpringBoot Json
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
@Configuration
class Json {
@wmira
wmira / kotlinjsnotes.md
Last active May 17, 2020 17:06
KotlinJS Notes

Trying to get my feet wet with kotlinjs. Here are a few things that are not so obvious that could help you.

  1. Make sure you use the Gradle > Kotlin Javascript. This has all the tools you need for auto reload/compile etc.
  2. When you run the project from Intellij, add the --continuous arguments from within IntelliJ Run. This ensures that when you do any changes, your project gets recompiled and reloaded automatically on your browser.
  3. Edit src/resources/index.html. The <script> tag has the bundled js code is under the head element. This will cause issue because your javascript will get executed before the whole document is rendered. Place before the end of the body closing tag.

Ref:

https://stackblitz.com/edit/vitejs-vite-opq6uv9r?file=src%2Fmain.js