About array and slice
https://blog.golang.org/slices
https://blog.golang.org/slices-intro
https://github.com/golang/go/wiki/SliceTricks
https://www.calhoun.io/how-to-use-slice-capacity-and-length-in-go/
// package.json | |
{ | |
"name": "todo-api", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "nodemon todos.js" | |
}, |
const express = require('express') | |
const { v4: uuid } = require('uuid') | |
const app = express() | |
// Product | |
// - ID: UUID (String) | |
// - Name: String | |
// - Type: String | |
// - Price: Number |
console.log('hello world'.length) | |
console.log('hello world'.charAt(0)) | |
console.log('hello world'.split(' ')) | |
console.log('hello world'.substring(1, 7)) | |
// 012345678910 | |
console.log(1) | |
console.log(1.1) | |
console.log(1.1 + 1.3) |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="preconnect" href="https://fonts.gstatic.com"> | |
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,700;1,400&display=swap" |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
ul { | |
list-style: none; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<button id="click">click me</button> |
// VFL (View Format Language) จริงๆดูดีนะ แต่น่าจะไม่รองรับทุกเคส | |
let views = [ | |
"redView": redView, | |
"greenView": greenView | |
] | |
let metrics = [ | |
"padding": padding, | |
"spacing": spacing |
ก่อนอื่นต้องให้เครดิตเจ้าของไอเดียก่อนนะครับ ซึ่งก็คือน้องบอสที่เป็นเทพ Javascript ในทีมนะครับ ถึงแม้น้องแม่งจะกวนตีนเหี้ยๆ ก็ตาม ผมก็ดีใจที่ได้ทำงานกับน้องเค้านะครับ | |
โอเค เรามาเริ่มที่หน้างานกันเลยดีกว่า งานของเราเป็นการทำหน้า setting ที่จะให้ user เชื่อม account ของตัวเองกับ Social Network Provider แต่ละเจ้าผ่าน Firebase นะครับ | |
type Server { | |
e: *echo.Echo | |
// เพิ่ม shared dependencies | |
// ไว้ต่อจากนี้ครับ | |
// .. | |
} | |
func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { | |
e.ServeHTTP(w, r) | |
} |