Skip to content

Instantly share code, notes, and snippets.

View minhqnd's full-sized avatar
🐧
caccac

Quang Minh minhqnd

🐧
caccac
View GitHub Profile
@minhqnd
minhqnd / fap.py
Last active February 12, 2025 18:01
Convert FAP FPT Calendar to ics
import json
import uuid
from datetime import datetime, timezone
def create_event(data):
"""Format each event for the iCalendar file with Apple-specific attributes."""
event_template = """BEGIN:VEVENT
TRANSP:OPAQUE
DTSTART;TZID=Asia/Ho_Chi_Minh:{start_time}
DTEND;TZID=Asia/Ho_Chi_Minh:{end_time}
@sontl
sontl / country-detect-cf-worker.js
Created December 27, 2024 07:49
Country detection using CF Worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const headers = {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
}