Skip to content

Instantly share code, notes, and snippets.

View apiphoomchu's full-sized avatar
:dependabot:
Blue Union

Api Phoom apiphoomchu

:dependabot:
Blue Union
View GitHub Profile
@apiphoomchu
apiphoomchu / README.md
Created September 22, 2025 13:38 — forked from alexanderbuhler/README.md
Tailwind v4 polyfill / browser compatibility configuration

This gist may be your full solution or just the starting point for making your Tailwind v4 projects backwards compatible.

What it does

  • Effectively getting browser support down to Chrome 99 (and basically everything supporting @layer)
  • Pre-compute oklab() functions
  • Pre-compute color-mix() functions (+ replace CSS vars inside them beforehand)
  • Remove advanced instructions (colorspace) from gradients
  • Provide support for nested CSS (used by dark mode or custom variants with &)
  • Transform translate, scale, rotate properties to their transform: ... notation
  • Add whitespace to var fallbacks var(--var,) > var(--var, ) to help older browsers understand
//
// CoreDataStack.swift
// SquatCounter
//
// Created by Apiphoom Chuenchompoo on 20/2/2567 BE.
//
import CoreData
@objc(Activity)
#define LED_PIN 2 // LED connected to GPIO 2 (built-in LED on many ESP32 boards)
#define BUTTON_PIN 4 // Button connected to GPIO 4
#define DEBOUNCE_DELAY 50 // Debounce time in milliseconds
unsigned long lastDebounceTime = 0; // Timestamp of the last button press
bool ledState = LOW; // LED state
bool buttonState = HIGH; // Current button state
bool lastButtonState = HIGH; // Previous button state
int pressCount = 0; // Button press counter
bool controlLED = true; // Allow button to control LED (true if not overridden by Serial input)
import SwiftUI
struct Movie: Identifiable {
let id = UUID()
let title: String
let description: String
var isWatched: Bool = false
}
struct ContentView: View {
import CoreData
@objc(Activity)
public class Activity: NSManagedObject {
@NSManaged public var time: Double
@NSManaged public var calories: Double
@NSManaged public var exerciseType: String
@NSManaged public var calBurnedType: String
@NSManaged public var activityCount: Int64
@NSManaged public var dateAndTime: Date
public static class Player {
private String name;
private Status status;
private int energy;
private int money;
private ArrayList<Food> foods;
private ArrayList<Potion> potions;
private ArrayList<Ore> ores;
public Player(String name, Status status, int energy, int money) {
@apiphoomchu
apiphoomchu / AppDelegate.swift
Created August 7, 2020 04:19
Clear URLCache in swift5
func applicationDidReceiveMemoryWarning(_ application: UIApplication) {
URLCache.shared.removeAllCachedResponses()
}