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 / 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 / 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 / AuthController.php
Last active February 20, 2021 11:57
Api Authentication
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
class AuthController extends Controller
@silkyland
silkyland / api.php
Created February 20, 2021 11:58
Api Auth Login, register, me, logout
<?php
use App\Http\Controllers\AuthController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
@silkyland
silkyland / UserController.php
Created February 20, 2021 12:18
UserController create, update, delete
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
class UserController extends Controller
{
<?php
namespace App\Http\Controllers;
use App\Models\Category;
use Illuminate\Http\Request;
class CategoryController extends Controller
{
public function apiIndex()
<?php
namespace App\Http\Controllers;
use App\Models\Post;
use Illuminate\Http\Request;
class PostController extends Controller
{
public function apiIndex()
@silkyland
silkyland / docker-compose.yml
Last active March 3, 2021 04:04
Mariadb + PhpMyAdmin docker-compose.yml
version: '3.1'
services:
db:
image: mariadb
restart: always
ports:
- 3306:3306
environment:
@silkyland
silkyland / main.dart
Created August 4, 2021 16:50
[Dart Lang] Algorithm : แสดงผลรูปหัวใจ และ เลื่อนรูปหัวใจลงทีละ step
void main() {
for (var i = 0; i <= 5; i++) {
show(i);
}
}
void show(int n) {
// กำหนด list ของจุดค่าเริ่มต้น
print("Step ที่ " + n.toString() + " : ");
@silkyland
silkyland / CertStorageError.MD
Last active February 23, 2023 09:04
[Solved] CertStorageError: expected /etc/letsencrypt/live/example.com/cert.pem to be a symlink

[Solved] CertStorageError: expected /etc/letsencrypt/live/example.com/cert.pem to be a symlink

  rm -rf /etc/letsencrypt/live/{yourdomain.com}
  rm -rf /etc/archive/{yourdomain.com}
  rm -rf /etc/renewal/{yourdomain.com}

and