Skip to content

Instantly share code, notes, and snippets.

View victorBaro's full-sized avatar
👾

Victor Baro victorBaro

👾
View GitHub Profile
@jtvargas
jtvargas / MatrixEffect.swift
Created September 9, 2024 01:24
Stress Fiddle App in SwiftUI
//
// MatrixEffect.swift
//
// Created by J.T on 9/8/24.
//
import SwiftUI
import Combine
class MatrixEffectModel: ObservableObject {
@T1T4N
T1T4N / gist:f66a2ebbeb17b73d6643a178ede14639
Created June 18, 2024 14:54
Disable Xcode 16's Predictive Code Completion LLM Model
defaults write com.apple.dt.Xcode IDEModelAccessHasUserConsentForOnDeviceInteractions -bool FALSE
@realvjy
realvjy / ChoasLinesShader.metal
Last active April 16, 2025 00:45
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);
@alikaragoz
alikaragoz / RubberBandSwitch.swift
Created October 12, 2023 12:20
iOS Control Center Rubber Band Swift
import SwiftUI
struct RubberBandSwitch: View {
enum Const {
static let shapeSize: CGSize = .init(width: 90.0, height: 190.0)
static let cornerRadius: CGFloat = 26.0
}
@State var value = 0.5
@stammy
stammy / LiquidBlobs.swift
Last active April 24, 2025 04:50
Liquid Blob effect with SwiftUI
//
// ContentView.swift
// LiquidCircles
//
// Created by Paul Stamatiou on 10/10/22.
//
import SwiftUI
struct ContentView: View {
@skypanther
skypanther / CIFilter+Extension.swift
Created April 8, 2019 20:28 — forked from ha1f/CIFilter+Extension.swift
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@nicklockwood
nicklockwood / Withable.swift
Created January 28, 2019 12:06
Withable.swift
/// Withable is a simple protocol to make constructing
/// and modifying objects with multiple properties
/// more pleasant (functional, chainable, point-free)
public protocol Withable {
init()
}
public extension Withable {
/// Construct a new instance, setting an arbitrary subset of properties
init(with config: (inout Self) -> Void) {
@smileyborg
smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active November 3, 2024 16:25
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
@tahmmee
tahmmee / opencv_text_detect
Created December 16, 2016 14:29
opencv Text Detection in ios
+ (UIImage*) detectWithImage: (UIImage*) inputImage
{
cv::Mat src = [inputImage CVMat3];
// Extract channels to be processed individually
std::vector<cv::Mat> channels;
cv::text::computeNMChannels(src, channels);
int cn = (int)channels.size();
@MP0w
MP0w / IntrinsicSizeAwareScrollView.swift
Created November 29, 2016 13:47
A `UIScrollView` subclass that adapts its `intrinsicContentSize` to its `contentSize`
import Foundation
import UIKit
/// A `UIScrollView` subclass that adapts its `intrinsicContentSize` to its `contentSize`
final class IntrinsicSizeAwareScrollView: UIScrollView {
private let keyPath = NSStringFromSelector(#selector(getter: contentSize))
override init(frame: CGRect) {
super.init(frame: frame)