Use TextEditor in SwiftUI to create something like a multi-line text field in your apps! Handy functionality courtesy of Apple. 馃檪
Author Archives: Paul Young-Suk Lee
驴C贸mo print (o imprimir) un diccionario bonito en Python en la terminal? Impresi贸n bonita de datos
Se puede utilizar el modulo pprint para imprimir datos bonitos en la terminal. Como el abajo. Asegurarse que est谩 usando width si su diccionario encaja en una linea. Como los docs dicen La representaci贸n formateada mantiene los objetos en una sola l铆nea siempre que sea posible y los divide en varias l铆neas si no encajanContinue reading “驴C贸mo print (o imprimir) un diccionario bonito en Python en la terminal? Impresi贸n bonita de datos”
How to pretty print a dictionary in Python within a terminal?
There’s a built-in module in Python called pprint it allows you to “pretty print” data structures in Python. To use it import the module, and wrap anything you want to print with pprint instead of print. Remember to force width if you have a dictionary that fits on a single line. From the docs SingleContinue reading “How to pretty print a dictionary in Python within a terminal?”
GraphQL advantage: a single endpoint for all the data
I haven’t used much of GraphQL but it seems like the main selling point is that as a client you can just query one endpoint, instead of multiple with traditional REST API’s. There’s probably much give and take here, given that it might relieve clients from having to wrangle endpoints to get their data butContinue reading “GraphQL advantage: a single endpoint for all the data”
Why I love to use Sourcegraph for my own projects
At my current place of employment, Lyft, we use Sourcegraph which is an open source tool that allows you to search across many, many repos at once. It’s basically Google for any and all code. I also use Sourcegraph on my own projects to search across my own projects or ramp up on open sourceContinue reading “Why I love to use Sourcegraph for my own projects”
How to get the current date in SwiftUI for views
In SwiftUI there are two handy abstractions available to you to format dates for your views. Date DateFormatter You can think of Date as the data piece of it giving you information on the current year, month, time, timezone etc. while you can think of DateFormatter as the piece that will give you that dataContinue reading “How to get the current date in SwiftUI for views”
How to authenticate Google Requests with Stytch OAuth API
I recently came across this service called Stytch which allows for passwordless authentication solutions after reading about them raising a series B round. As any tech nerd, I’m always interested in these new services popping up. Turns out, you can do OAuth logins! What better way to get familiar with a service than by tryingContinue reading “How to authenticate Google Requests with Stytch OAuth API”
How to create a calendar in SwiftUI with Grid Layout
So I’ve been building this productivity app because well, I’m a nerd and like doing things like that. In my pursuit I had to create a calendar view like the one above so a user can see how many days they’ve consecutively accomplished some task. In my pursuit I didn’t find any pure SwiftUI resourcesContinue reading “How to create a calendar in SwiftUI with Grid Layout”
How to authorize requests to Google Calendar API
Though I use Python here, the flow should generally be the same across all languages and APIs. You don’t have to be a Python or flask expert to understand this post as it’s more about the OAuth2 lifecycle with Google APIs but, I recommend having the docs open on flask and Python to understand someContinue reading “How to authorize requests to Google Calendar API”
Toggle AppStorage values in subviews in SwiftUI (iOS14+, Xcode13+)
Redefine the AppStorage in subviews with UserDefaults and toggle the value directly in subviews to have it reflected in parent views.