Skip to content

Instantly share code, notes, and snippets.

View rismay's full-sized avatar
🏠
Working from home

Cristian A Monterroza rismay

🏠
Working from home
View GitHub Profile
@realvjy
realvjy / ChoasLinesShader.metal
Last active July 1, 2024 06:48
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);
@kconner
kconner / macOS Internals.md
Last active June 27, 2024 18:48
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@alexng353
alexng353 / nextjs.yml
Last active May 9, 2024 04:08
Next JS build test GitHub action
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Check NextJs build
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
struct ConcaveGlassView: ViewModifier {
func body(content: Content) -> some View {
if #available(iOS 15.0, *) {
content
.padding()
.frame(height: 50)
.background(.ultraThinMaterial)
.overlay(
RoundedRectangle(cornerRadius: 14)
.stroke(.linearGradient(colors:[.black,.white.opacity(0.75)], startPoint: .top, endPoint: .bottom), lineWidth: 2)
struct ConcaveGlassViewWithOverlay: ViewModifier {
func body(content: Content) -> some View {
if #available(iOS 15.0, *) {
content
.padding()
.frame(height: 50)
.background(.ultraThinMaterial)
.overlay(
LinearGradient(colors: [.black.opacity(0.2), .clear], startPoint: .top, endPoint: .bottom))
.cornerRadius(14)
struct FlatGlassView : ViewModifier {
func body(content: Content) -> some View {
if #available(iOS 15.0, *) {
content
.padding()
.frame(height: 50)
.background(.ultraThinMaterial)
.cornerRadius(14)
} else {
// Fallback on earlier versions
@dduan
dduan / bird.swift
Created November 14, 2020 22:16
Flappy bird as a CLI app written in Swift.
// This is the code for the Flappy Bird game running in a Unix terminal.
// Demo: https://twitter.com/daniel_duan/status/1327735679657250816?s=21
// To run it, simply do "swift bird.swift" in a Unix command line.
#if canImport(Darwin)
import Darwin
#else
import Glibc
#endif
enum RawModeError: Error {
@samwize
samwize / DynamicKey.swift
Created September 28, 2017 06:59
A CodingKey that is dynamic -- it can be any string! Encode/decode with a Dictionary of `[String : Any]` in the model.
/**
```
// Encode a model with properties of type [String : Any]
var propertiesContainer = container.nestedContainer(keyedBy: DynamicKey.self, forKey: .properties)
if let properties = properties {
try propertiesContainer.encodeDynamicKeyValues(withDictionary: properties)
}
```
*/
struct DynamicKey: CodingKey {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 29, 2024 14:26
Swift Concurrency Manifesto

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?