Skip to content

Instantly share code, notes, and snippets.

@ongkiii
ongkiii / IPA-Sources.md
Last active December 8, 2025 11:53
REPOS/TELEGRAM CHANNELS LIST BY u/angkitbharadwaj
import SwiftUI
struct ContentView: View {
@StateObject private var viewModel = RectsViewModel()
var body: some View {
GeometryReader { geometry in
TimelineView(.animation) { timeline in
Canvas {context, size in
let rects = viewModel.rects
@niw
niw / use_var_in_struct.md
Last active December 1, 2025 02:11
Use `var` in `struct` in Swift

Use var in struct in Swift

TL;DR: Use var for properties in struct as long as it serves as a nominal tuple. In most cases, there is no obvious benefit to using let for struct properties.

Simple Example

Let's start with a simple example:

struct MyStruct {
@realvjy
realvjy / ChoasLinesShader.metal
Last active December 2, 2025 08:11
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@zats
zats / ContentView.swift
Last active November 13, 2025 22:03
Internal SF Symbols
struct ContentView: View {
var body: some View {
let names = [
["appstore.app.dashed", "buildings.3d", "emoji.chicken.face"],
["person.text.rectangle.and.nfc", "secure.element", "laugh.bubble.tapback.2.he"],
["apple.news", "apple.podcasts.square.stack", "apple.slice"],
]
VStack(spacing: 20) {
Grid(horizontalSpacing: 20, verticalSpacing: 20) {
ForEach(names, id: \.self) { nameRow in
@Koshimizu-Takehito
Koshimizu-Takehito / OscillatingEffect.swift
Last active November 25, 2024 13:15
ホームスクリーンのアイコンのブルブルするやつ
import SwiftUI
let symbols = [
"pencil",
"trash",
"folder",
"camera",
"photo",
"clock",
"arrow.right.circle.fill",
@AlexKobachiJP
AlexKobachiJP / EditMode.swift
Last active May 14, 2025 05:36
Reimplementation of SwiftUI EditMode enum for macOS
// Documentation comments are copied from the official documentation for iOS.
import SwiftUI
#if os(macOS)
/// Reimplemenation of [EditMode](https://developer.apple.com/documentation/swiftui/editmode) for macOS.
public enum EditMode {
/// The user can edit the view content.
@mecid
mecid / Calendar.swift
Last active September 2, 2025 01:55
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)
@PaulWoodIII
PaulWoodIII / SelectedItems.swift
Created August 19, 2019 00:02
quick example of how to use selection in a SwiftUI list, an ObservableObject provides the content as well
//: [Previous](@previous)
import SwiftUI
import Combine
import PlaygroundSupport
class Context: ObservableObject {
@Published var selectedItems: Set<String>
@Published var items: Array<String>
@Oranzh
Oranzh / AES-256 encryption and decryption in PHP and C#.md
Created March 24, 2018 04:19
AES-256 encryption and decryption in PHP and C#

AES-256 encryption and decryption in PHP and C#

Update: There is a more secure version available. Details

PHP

<?php

$plaintext = 'My secret message 1234';