Skip to content

Instantly share code, notes, and snippets.

View SemmiDev's full-sized avatar
🎯
Focusing

Sammi Aldhi Yanto SemmiDev

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Go Memory Access Visualization</title>
<style>
* {
margin: 0;
padding: 0;
package main
import (
"context"
"fmt"
"log"
"time"
)
// Define a generic CommandHandler interface with a Handle method
@SemmiDev
SemmiDev / App.vue
Created February 8, 2024 14:25
vue unlimited scroll example
<template>
<div>
<div v-for="(todo, index) in todos" :key="index" class="todo">
{{ todo.title }}
</div>
<div v-if="loading" class="loading">Loading...</div>
</div>
</template>
<script setup>
@SemmiDev
SemmiDev / App.vue
Created February 8, 2024 14:16
vue suspense example
<style scoped>
@import url('https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap');
div#main {
font-family: 'Indie Flower', cursive;
}
</style>
<template>
<div id="main" class="p-5 flex-col mx-auto border-slate-700 max-w-xl w-full flex h-screen">
<!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>Search Instructor</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
package main
import (
"context"
"encoding/csv"
"encoding/json"
"fmt"
"github.com/go-chi/chi/v5"
"github.com/google/uuid"
"github.com/jackc/pgx/v5/pgxpool"
package main
import (
"context"
"errors"
"fmt"
"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"net/mail"
"strings"
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE instructors
(
id UUID PRIMARY KEY,
name VARCHAR NOT NULL,
occupation VARCHAR NOT NULL,
email VARCHAR NOT NULL,
name_tsvector TSVECTOR GENERATED ALWAYS AS (TO_TSVECTOR('indonesian', name)) STORED,
occupation_tsvector TSVECTOR GENERATED ALWAYS AS (TO_TSVECTOR('indonesian', occupation)) STORED,
version: "3.9"
services:
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=fts
ports:
- "5432:5432"
@SemmiDev
SemmiDev / index.html
Created July 10, 2023 07:43
url shortener
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>URL Shortener</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>