Skip to content

Instantly share code, notes, and snippets.

@neilsmithdesign
neilsmithdesign / swift-ui-protocol-view-models.swift
Last active June 18, 2024 15:24
SwiftUI views with protocol interfaces to view models.
import SwiftUI
/// View model protocol
protocol ViewModel: ObservableObject {
var count: Int { get }
func increase()
}
/// Concrete implementation
class MyViewModel: ViewModel {
//
// Picker.swift
// Crypic
//
// Created by Takeshi Tanaka on 2020/05/16.
// Copyright © 2020 p0dee. All rights reserved.
//
import SwiftUI
@IsaacXen
IsaacXen / README.md
Last active April 12, 2025 01:49
(Almost) Every WWDC videos download links for aria2c.
@mshafer
mshafer / ContentView.swift
Last active October 11, 2024 13:00
Slide-over card (like in Maps or Stocks) using SwiftUI
import SwiftUI
struct ContentView : View {
var body: some View {
ZStack(alignment: Alignment.top) {
MapView()
SlideOverCard {
VStack {
CoverImage(imageName: "maitlandbay")
Text("Maitland Bay")
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active April 22, 2025 13:43
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active April 23, 2025 02:00
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@loretoparisi
loretoparisi / MusicPlayerManager.swift
Created July 14, 2017 09:10
Ambiguous use of play of MPMusicPlayerController in iOS11, swift4 - Apple Example "Adding Content to Apple Music"
/*
See LICENSE folder for this sample’s licensing information.
Abstract:
The `MusicPlayerManager` manages the media playback using the `MPMusicPlayerController` APIs.
*/
import UIKit
import MediaPlayer
@Erkened
Erkened / ScrollViewExample+TextField.swift
Last active February 17, 2020 05:16
UIScrollView example, with a textfield that's not covered when the keyboard appears, fully programmatic with AutoLayout. Swift 4.0
//
// ViewController.swift
// Repnote
//
// Created by John Neumann on 05/07/2017.
// Copyright © 2017 Audioy. All rights reserved.
//
import UIKit
@klemenzagar91
klemenzagar91 / MulticastDelegateV2.swift
Created June 22, 2017 12:16
Multicast Delegate with hash table
class MulticastDelegate <T> {
private let delegates: NSHashTable<AnyObject> = NSHashTable.weakObjects()
func add(delegate: T) {
delegates.add(delegate as AnyObject)
}
func remove(delegate: T) {
for oneDelegate in delegates.allObjects.reversed() {
if oneDelegate === delegate as AnyObject {
@aparrish
aparrish / understanding-word-vectors.ipynb
Last active April 9, 2025 14:04
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.