Skip to content

Instantly share code, notes, and snippets.

View luthviar's full-sized avatar

Luthfi Abdur Rahim luthviar

View GitHub Profile
@luthviar
luthviar / RequestReviewSwiftUI.swift
Last active August 26, 2025 04:28
RequestReviewSwiftUI.swift
import SwiftUI
import StoreKit
struct ContentView: View {
@State private var counter: Int = 0
var body: some View {
VStack(spacing: 20) {
Text("Hello, World!")
.font(.largeTitle)
//
// ContentView19.swift
// Coba14July2025
//
// Created by Luthfi Abdurrahim on 21/08/25.
//
import SwiftUI
// MARK: - Models
@luthviar
luthviar / SimpleAddOtherProductBottomAndShare.swift
Last active August 14, 2025 08:54
SimpleAddOtherProductBottomAndShare SwiftUI
//
// ContentView16.swift
// Coba14July2025
//
// Created by Luthfi Abdurrahim on 14/08/25.
//
import SwiftUI
struct DiscoverProductsCard: View {
@luthviar
luthviar / PINInputOverlay.swift
Created June 25, 2025 07:24
PINInputOverlay.swift
import SwiftUI
// MARK: - Reusable PIN Input Overlay View
struct PINInputOverlay: View {
@State private var enteredPIN = ""
@FocusState private var isTextFieldFocused: Bool
@Binding var isPresented: Bool
let title: String
let onPINSubmitted: (String) -> Void
@luthviar
luthviar / BiometricSwiftUI.swift
Created June 20, 2025 03:16
BiometricSwiftUI.swift
// MARK: DON'T FORGET TO ADD in Info.plist:
// <key>NSFaceIDUsageDescription</key>
// <string>Kami membutuhkan akses Face ID untuk otentikasi biometrik.</string>
import SwiftUI
import LocalAuthentication
struct ContentView: View {
@StateObject private var viewModel = BiometricAuthViewModel()
@luthviar
luthviar / DesignPattern.md
Created March 21, 2025 05:45
DESIGN PATTERN WITH USE CASES EXAMPLE
@luthviar
luthviar / navcontroller.swift
Created March 7, 2025 08:08
navcontroller.swift
import SwiftUI
enum Route: Hashable {
case push(PushDestination)
case modal(ModalDestination)
case sheet(SheetDestination)
}
enum PushDestination: Hashable {
case detail
@luthviar
luthviar / Simple2048.swift
Created February 10, 2025 14:12
Simple 2048 Game with SwiftUI
import SwiftUI
struct GameBoard: Equatable {
var board: [[Int]]
var score: Int
init() {
board = Array(repeating: Array(repeating: 0, count: 4), count: 4)
score = 0
addNewTile()
@luthviar
luthviar / geminillmai+scraping-main.go
Created January 23, 2025 02:39
This is a code in GOLANG for: gemini LLM integrate with scraping then can answer your question based on scraping website
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
@luthviar
luthviar / SimpleGithubWebhook.php
Created January 14, 2025 03:29
PHP Code for Simple Github Webhook
<?php
define('TELEGRAM_BOT_API_KEY', 'put your api key here');
define('TELEGRAM_CHAT_ID', 'put your chat id here'); // for sending messages to groups use number of chat_id with minus '-' before, example -1238735917
define('TELEGRAM_THREAD_ID', 'your id number here'); // for topics a group, like a sub group
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$payload = json_decode($_POST['payload']);
$type_event = $_SERVER['HTTP_X_GITHUB_EVENT'];