Sabitlenmiş Tweet
Ellie
3.1K posts

Ellie
@Ellie_Xtech
Backend & Low-Level Dev | Systems Architect | Code Optimizer 👩💻
Missouri, USA Katılım Ekim 2023
89 Takip Edilen25 Takipçiler
Ellie retweetledi

Ellie retweetledi
Ellie retweetledi
Ellie retweetledi

Never do this.
HTTP 200 already means there is no error.
Don’t reinvent the bicycle. Don’t overcomplicate.
Kartik@kartik_builds
Update your API response format now 🙏🙏
English
Ellie retweetledi
Ellie retweetledi

For those asking, I designed this directly with code.

Easlo@heyeaslo
New onboarding pages for my app.
English
Ellie retweetledi

Quick update on the Linux & USB reverse-engineering challenge:
So, we're getting raw, unfiltered bytes from /dev/hidraw0. But what do they mean? Is byte 3 the battery level or the load? It's a black box.
This is where the 'magic' of Linux and the USB HID protocol comes in.
The device doesn't just send data. It first sends an "instruction manual" called a Report Descriptor. This descriptor is a binary schema that defines its entire data protocol.
And the Linux kernel, following the "everything is a file" philosophy, just... saves this manual as a file for you.
You can find it here: /sys/class/hidraw/hidraw0/device/report_descriptor
On its own, it's unreadable binary. But we can use a standard tool like hidrd-convert to decode it.
The output looks almost like a script. It's the "schema" that tells us:
"Usage (Battery Percentage)"
"Logical Minimum (0)"
"Logical Maximum (100)"
"Report Size (8 bits)"
We don't have to guess. We just have to read the manual the kernel already saved for us.
Now, the real work begins: writing a parser for this schema to decode the raw bytes.

English
Ellie retweetledi
Ellie retweetledi
Ellie retweetledi

Swift for Android vs Kotlin Multiplatform: Modelling your data (+ JNI crash course)
Swift for Android models use Codable to automatically parse out JSON data into a struct, a value type useful for simple data transfer (screenshot #1).
Android apps will call into the Swift code via JNI bindings generated from our code using swift-java. JNI, or Java Native Interface, allows Java code running on the JVM to talk to other languages. swift-java is the interoperability layer that creates Java interfaces from our Swift module code, allowing it to be compiled as a native Android library.
Marshalling arrays and handling Foundation types like URLs across the module boundary can be brittle and error-prone, so I created some simple bridging code to expose primitive-typed getters for Foundation types like URL and implementing array indexing (screenshot #2).
Kotlin Multiplatform code stores data in a data class, a reference type for which Kotlin synthesises a bunch of value-like behaviour for copying, equality, and printing.
It uses a @Serializable data class to store data, which basically works just like Codable. If you’re used to the giant umbrella module that is Foundation, it might look strange to individually import every package like kotlinx.serialization.Serializable, but this is how pretty much every ecosystem outside iOS does it (screenshot #3).
Read my full analysis, Swift Android vs Kotlin Multiplatform, here 🚀 blog.jacobstechtavern.com/p/swift-for-an…



English
Ellie retweetledi

☑︎ Implementation
☑︎ Docs
☑︎ Demo
☐ Blog post
Jan Amann@jamannnnnn
Is this the Tailwind of i18n? 👀
English
Ellie retweetledi
Ellie retweetledi

Here is an example of using a deeply nested Pydantic Schema with +30 fields, Union, Optionals and recursive structures with the new Sturctured Structured Outputs in the Gemini API! 💥
Note: To enable this you need to use the new `response_json_schema` parameter instead of the old `response_schema`. Documentation and Snippet below.

English
Ellie retweetledi
Ellie retweetledi
Ellie retweetledi
Ellie retweetledi
Ellie retweetledi

This generic property can transform a Binding<T?> into a Binding<Bool> so that you can drive navigation with optional state instead of booleans. This fixes a flawed SwiftUI API for displaying alerts.
More info in this week's episode @ 22:43
👉#t1363" target="_blank" rel="nofollow noopener">pointfree.co/collections/mo…

English
Ellie retweetledi
Ellie retweetledi




















