Skip to content

Instantly share code, notes, and snippets.

View silkyland's full-sized avatar
💭
On time

Bundit Nuntates silkyland

💭
On time
View GitHub Profile
@silkyland
silkyland / todolistmockup.js
Created June 28, 2018 16:07
Todo list mockup
import React, { Component } from "react";
class App extends Component {
render() {
return (
<div
style={{
borderColor: "#e12c6a",
borderWidth: 2,
borderStyle: "solid",
@silkyland
silkyland / How to resolve module error
Last active December 8, 2017 09:02
Error: bundling failed: UnableToResolveError: Unable to resolve module ....
error: bundling failed: UnableToResolveError: Unable to resolve module `inspector` from `/Users/.....`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.
@silkyland
silkyland / fixnotify.txt
Last active November 28, 2023 16:06
A problem occurred configuring project ':app', Failed to notify project evaluation listener, javax/xml/bind/annotation/XmlSchema
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> javax/xml/bind/annotation/XmlSchema
--
If you got error like above that mean "You are using JDK higher than graddle need eg. You install JDK 9 it should be 8"
How to fix:
1) Remove JDK version 9 by
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
@silkyland
silkyland / strToThaiSlug.js
Last active January 20, 2024 19:15
Convert string to slug in Thai language for SEO Friendly in JavaScript
/**
* Translates a string to a Thai slug format.
* @param {string} inputString - The string to translate.
* @returns {string} The translated string.
*/
function toThaiSlug(inputString) {
// Replace spaces with hyphens
let slug = inputString.replace(/\s+/g, '-');
// Translate some characters to Thai