Skip to content

Instantly share code, notes, and snippets.

View yasalmasri's full-sized avatar

Yaser Almasri yasalmasri

View GitHub Profile
@yasalmasri
yasalmasri / CurrencyField.swift
Last active September 25, 2022 05:13
Currency Field SwiftUI
//
// ContentView.swift
// CurrencyField
//
// Created by Yaser Almasri on 24/09/22.
//
import SwiftUI
struct ContentView: View {
@yasalmasri
yasalmasri / compound_interest.rb
Created December 13, 2023 21:51
compound_interest.rb
require 'amazing_print'
def interest(amount:, rate:, months:, years:)
a = amount
1.upto(years) do
1.upto(months) do |month|
a += a * rate/months
a += amount
end
end
@yasalmasri
yasalmasri / Calendar.swift
Created January 3, 2026 04:58 — forked from mecid/Calendar.swift
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@yasalmasri
yasalmasri / wled_segmented_notifications.yaml
Last active January 4, 2026 05:34 — forked from Anashost/wled_segmented_notifications.yaml
WLED Notification – Home Assistant Blueprint Turn a WLED strip into a smart notifier: each segment shows custom colors, effects, and brightness for different events, then automatically returns to its original state or a default preset when notifications clear.
blueprint:
name: WLED Segmented Notifications
description: >-
Control up to 4 segments on a single WLED strip for independent notifications.
domain: automation
input:
wled_device:
name: WLED Light Entity
selector:
@yasalmasri
yasalmasri / light_notifications.yaml
Last active January 7, 2026 03:15
Light Notifications
blueprint:
name: Light Notifications
description: Turn a light on based on boolean helpers.
domain: automation
input:
target_light:
name: Target Light Entity
selector:
entity:
domain: light
#!/bin/sh
# A logging script to be executed by the Objective-See OverSight tool:
#
# https://objective-see.org/products/oversight.html
#
# Logs microphone and camera events, including the process path and user
# if available.
#
# By Keith McCammon // kwm.me