Skip to content

Instantly share code, notes, and snippets.

View elkraneo's full-sized avatar
🌍

Cristian Díaz elkraneo

🌍
View GitHub Profile
//
// ContentView.swift
//
//
// Created by Bernstein, Joel on 7/4/20.
//
import SwiftUI
struct ElementModel: Identifiable
@IsaacXen
IsaacXen / README.md
Last active April 16, 2024 15:54
(Almost) Every WWDC videos download links for aria2c.
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 16, 2024 10:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@marcedwards
marcedwards / circlesofdots.pde
Created June 28, 2019 10:43
Circles of dots in Processing
//
// Circles of dots.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1144236924095234053
//
@atomicbird
atomicbird / wwdc2019-online-sessions.md
Last active May 29, 2020 22:59
WWDC 2019 Online-only Sessions

At WWDC 2019 Apple released some videos directly online, with no corresponding live session. This is a list of those videos with links to the video pages.

Some sessions were presented during WWDC but then split into multiple videos when posted online. This list includes the online versions, since they don't appear in the WWDC schedule. For example WWDC included session 711, "Introducing Combine and Advances in Foundation". This was split into two online videos-- 722, "Introducing Combine", and 723, "Advances in Foundation". Both 722 and 723 are included here.

@ohayon
ohayon / DraggableView.swift
Last active April 5, 2023 16:24
Example of making a reusable `draggable()` modifier for SwiftUI Views
struct DraggablePita: View {
var body: some View {
Image(uiImage: UIImage(named: "pita.png")!)
.draggable() // Add the new, custom modifier to make this draggable
}
}
// Handle dragging
struct DraggableView: ViewModifier {
@State var offset = CGPoint(x: 0, y: 0)
@matthewreagan
matthewreagan / Perlin
Last active March 30, 2024 16:18
Perlin noise generation in Swift
// Perlin.swift
// Created by Matthew Reagan on 8/7/18.
//
// Quick implementation of the the classic Perlin noise
// generation function, useful for creating organic textures
// or terrain. Perlin noise can also be easily generated with
// Apple's GameplayKit framework, this code is mostly for
// experimentation purposes. (Disclaimer: This code is not
// optimized, nor particularly elegant, but it can be used as
// a jumping off point for writing custom noise functions.)
@AdrianBinDC
AdrianBinDC / MapRegionUtility.swift
Last active May 19, 2023 01:13
Generate a MKCoordinateRegions for continents and major oceans
//
// MapRegionUtility.swift
// QuakeData
//
// Created by Adrian Bolinger on 7/9/18.
// Copyright © 2018 Adrian Bolinger.
//
/*
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: