Marnix Janssen's Avatar

Marnix Janssen

@marnixjanssen.com.bsky.social

Typescript and Rust @ https://pola.rs

22 Followers  |  57 Following  |  9 Posts  |  Joined: 12.11.2023  |  1.6323

Latest posts by marnixjanssen.com on Bluesky

Next.js works quite well with this setup tbh. Using the middleware and the route.ts routes that it offers, a lot of code that should be handled server-side, is handled server side.

01.12.2024 20:31 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Mostly CSR, but all authentication stuff is handled server-side. Building dynamic dashboards is quite difficult using SSR.

01.12.2024 20:29 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Appreciate the plug for Advent of Typescript @tkdodo.eu πŸ‘

01.12.2024 13:51 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
screenshot of zed editor, somehow both calming and vibrant, mmm

screenshot of zed editor, somehow both calming and vibrant, mmm

@zed.dev is so beautiful, a vibe

26.11.2024 02:27 β€” πŸ‘ 564    πŸ” 13    πŸ’¬ 54    πŸ“Œ 6

This is nice! I like the fact that queries are defined in a separate queries directory

25.11.2024 17:16 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

eg.

- /data/queries/user.ts

import { queryOptions } form '@tanstack/react-query'

export const getPosts = queryOptions({
queryKey: ['posts'],
queryFn: getPosts,
})

- /components/feed.tsx

import { getPosts } from '/data/queries/user.ts'

const { data: posts } = useQuery(getPosts)

25.11.2024 11:00 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

Defining your #reactquery queries with queryOptions is probably the easiest way to keep your growing application maintainable

25.11.2024 11:00 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0
A diagram shows how to use str.split, list.first / list.last, cast, pl.int_ranges, and explode, all together, to turn a dataframe where a column may contain ranges like "3-5" into a similar dataframe where all ranges have been expanded, or exploded, across multiple rows.

The full code is:

range_start = pl.col("nrs").str.split("-").list.first().cast(pl.Int64)
range_end = pl.col("nrs").str.split("-").list.last().cast(pl.Int64)
df.with_columns(pl.int_ranges(range_start, range_end + 1)).explode("nrs")

A diagram shows how to use str.split, list.first / list.last, cast, pl.int_ranges, and explode, all together, to turn a dataframe where a column may contain ranges like "3-5" into a similar dataframe where all ranges have been expanded, or exploded, across multiple rows. The full code is: range_start = pl.col("nrs").str.split("-").list.first().cast(pl.Int64) range_end = pl.col("nrs").str.split("-").list.last().cast(pl.Int64) df.with_columns(pl.int_ranges(range_start, range_end + 1)).explode("nrs")

How to β€œexpand” ranges like "3-5" across new rows with the values 3, 4, 5?

This comes straight from our Discord server (discord.com/invite/4UfP5...)

21.11.2024 14:36 β€” πŸ‘ 7    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0
Diagram showing how `value_counts` produces a column with struct values, mapping column values to their counts.
We then show how to use `.struct.field` to extract a single field from the struct and how to use `.struct.unnest` to extract all fields into corresponding columns.

Diagram showing how `value_counts` produces a column with struct values, mapping column values to their counts. We then show how to use `.struct.field` to extract a single field from the struct and how to use `.struct.unnest` to extract all fields into corresponding columns.

Why is there a `struct` data type?

A single expression produces a single column, so expressions like `value_counts` need to output structs to map the values to their counts.

With that said, do you understand why `.struct.unnest` doesn't break the 1 expr = 1 column principle?

20.11.2024 11:14 β€” πŸ‘ 7    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0

A while ago I built my first OS project in Rust: a Telegram bot. It shares filterable deals subscribers. As of now, the bot shared over 1.2 million deals to subscribers, using only a Redis DB, without a second of downtime (thanks for hosting @glenndehaan.com πŸ‘)

github.com/mjanssen/pep...

18.11.2024 15:37 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
GitHub - aidenybai/react-scan: Scan for React performance issues and eliminate slow renders in your app Scan for React performance issues and eliminate slow renders in your app - aidenybai/react-scan

first post, i came here to say i made a thing today:

github.com/aidenybai/re...

14.11.2024 19:39 β€” πŸ‘ 85    πŸ” 10    πŸ’¬ 8    πŸ“Œ 3

@tannerlinsley.com What would/should stop me from migrating our (still) relatively small Next.js frontend to @tanstack.com Start?

14.11.2024 10:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

πŸ‘‹

14.11.2024 10:34 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@marnixjanssen.com is following 20 prominent accounts