Skip to content

Instantly share code, notes, and snippets.

View marcelocmenezes's full-sized avatar

Marcelo Menezes marcelocmenezes

View GitHub Profile
@ciiqr
ciiqr / zod-optional-null.ts
Last active July 16, 2024 01:25
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@gbuela
gbuela / NavViewDemo
Created February 9, 2020 03:14
Custom navigation bar in SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
Color.black
.edgesIgnoringSafeArea([.all])
NavigationLink(destination: ContentView2()) {
Text("push")
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",