Skip to content

Instantly share code, notes, and snippets.

View Guutong's full-sized avatar
🏠
Working from home

Pornmongkon Pongsai Guutong

🏠
Working from home
  • 22:06 (UTC)
View GitHub Profile
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
import axiosInstance from './axios';
export interface CreatePrivilegeFrom {
title: string;
image: string;
catalogId: string;
categoryId: string;
startDate: string;
endDate: string;
typeId: string;
point: number;
import { env } from './env';
import $axios from 'axios';
const baseURL = env.apiURL;
const axios = $axios.create({ baseURL });
axios.interceptors.request.use(
(config) => {
return new Promise((resolve) => {
interface ENV {
apiURL: string;
}
const pEnv = process.env as Record<string, string>;
console.log(pEnv)
export const env: ENV = {
apiURL: pEnv.REACT_APP_API_URL,
};
interface LoginForm {
username: string;
password: string;
}
function Login() {
const navigate = useNavigate();
const loginForm = useFormik<LoginForm>({
initialValues: {
username: '',
<div className="h-screen flex align-items-center justify-content-center">
<div className="card shadow-2 border-round w-4 p-4">
<div className="text-center text-3xl font-medium text-900 mb-3">Login</div>
<div className="field">
<label htmlFor="username" className="block">Username</label>
<InputText id="username" aria-describedby="username-help" className="block w-full b-3" />
<small id="username-help" className="block text-red-400">Enter your username</small>
</div>
<div className="field">
<label htmlFor="password" className="block">Password</label>
const data = [
{
id: 1,
name: "bulbasaur",
image:
"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/home/1.png",
types: ["grass", "poison"],
weight: 69,
height: 7,
abilities: ["overgrow", "chlorophyll"],
@Guutong
Guutong / main.go
Created July 19, 2022 05:00
Wongnai-Mysterious-Code
package main
import (
"encoding/base64"
"fmt"
"strings"
)
func main() {
secret := "aWFuZ25vVzpOQU06RU5JTDp0YTpzdTpuaW9K"
/* Global Styles */
* {
font-family: 'Roboto', Arial, sans-serif;
color: #616161;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@Guutong
Guutong / nested-form.component.html
Created July 12, 2018 15:21
demo reactive forms
<form [formGroup]="myForm">
Value: {{ myForm.value | json }}
<hr>
<input placeholder="First name" formControlName="firstName">
<input placeholder="Last name" formControlName="lastName">
<input placeholder="email" formControlName="email">
<input placeholder="phone" formControlName="phone">
<div formGroupName="address">
<input placeholder="house number, road" formControlName="address1">
<input placeholder="sub districe, district" formControlName="address2">