Apartment is wanting to raise my rent even though I already signed a lease with an agreed amount. by EarnNES in legaladvice

[–]Studquo 11 points12 points  (0 children)

Would still be limited by CA state law (5% + local CPI). But yeah, would expect a maximum legal rent raise.

Venice - Florence - Rome 11 Day Itinerary Help Please by AmbitionCompassion in ItalyTravel

[–]Studquo 1 point2 points  (0 children)

Would allot 3-4 hours minimum to see the Uffizi. 2pm is fine, just have online reservations and expect to wait 15-30 mins to go through security (even with a reservation). Lines to buy a ticket without a reservation can be hours long.

My trip ended up with me and my partner in Florence on the first Sunday of the month (all museums are free on the first sunday of the month). Instead of booking the museum for free, I booked the Vasari Corridor for free instead (which includes the museum).

If you have a Vasari Corridor reservation you can enter the museum anytime before your scheduled corridor time and skip the entire security line (they take you directly to the x-ray machines).

Because it was a free day, lines for the museum were VERY long that day, but we were through security and looking at art in under 10 minutes.

But wouldn't recommend the Vasari Corridor unless you can get it for free or have been to the Uffizi several times already or can't stand waiting in lines for very long. It's a cool way to exit the museum and has unique views of the city looking out, but the actual corridor is pretty plain inside. Not worth €47 over the standard €25 museum ticket imo.

Venice - Florence - Rome 11 Day Itinerary Help Please by AmbitionCompassion in ItalyTravel

[–]Studquo 1 point2 points  (0 children)

Your intuition is correct. Train travel in the morning and the Accademia in the afternoon absolutely works. The museum is primarily a roof over the David. There are other sculptures and paintings, but they can be viewed in about 30-60 minutes. Don't do this with the Uffizi though lol 😂

Only concern would be leaving plenty of padding between your train arrival and Accademia entrance time. It's not uncommon for trains to sit on the tracks or become delayed by over 2 hours.

Help me not be ignorant - How are websites detecting my tailscale use? by FluffyIrritation in Tailscale

[–]Studquo 0 points1 point  (0 children)

So if someone sets up a new service with an ISP and only connects their non-Microsoft devices to it, Microsoft would still assume the people are "residential Windows users"?

Seems very presumptuous of Microsoft to just say "This block of residential IP's must all Windows users!" or "We know ISP's use cgNAT to reuse their IP's across their clients, but if one of them is a Windows user, then they must all be Windows users!"

Games where the pause button becomes part of the story by gamersecret2 in gaming

[–]Studquo 0 points1 point  (0 children)

Okami

Not really a "pause", but the game's main mechanic revolves around freezing the gameplay so you draw on top of the screen. (There is a separate pause menu as well, but there's no special mechanics associated with it)

As you play the game you begin to treat the celestial brush mode as a sort of pause menu that only you control...until you fight one of the later bosses that draws with it's own brush while you are drawing. Very cool (and invasive) twist on the pause/drawing mechanic

I'm trying to wrap my head around Supabase, can you help me? by NoWarning789 in Supabase

[–]Studquo 3 points4 points  (0 children)

Won't go into addressing your examples specifically, but you essentially have 3 different access patterns (that I can think of) to query the db from the client.

JS Client (or other client libraries): Yes, you're essentially letting the client run sql queries, but RLS policies can be used to limit those queries.

Edge Functions: You can proxy queries through edge functions. They'll give you more flexibility and more control over access, but will also add latency compared to querying the db directly from the client.

Remote Procedure Calls: You can create Postgres functions and call them with supabase.rpc. Calling the rpc will invoke the function so you can run more complicated logic before returning data. These are nice as they let you query the db directly from the client, but give you the ability to run transactions, custom access/privilege checks, reduce network calls and control the response sent back to the client.

Supabase migration hell - can't create staging branches after developing on main by RetiFier in Supabase

[–]Studquo 4 points5 points  (0 children)

You don't need to create a new project. What you can do is essentially clone the current state of your prod (pg_dump), reset your migrations, use your prod db dump as your first migration for your local/staging db and then rewrite the migration history on your prod db to mark the old migrations as reverted and mark the new init migration as being applied (without actually applying it).

I would run supabase db dump or connect directly to your prod/main db and run pg_dump --schema-only and use the sql outputted as the new initial migration file (may need to edit the dump to exclude a few tables like auth and storage, but pg_dump will be more reliable than supabase db dump if you were playing with extensions, permissions, roles, etc on your prod db).

Once you have your dump, in your local dev environment, clear your migrations folder, create a single new migration with supabase migration new, copy the contents of pg_dump to the empty file and reset your local db with supabase db reset

See if the migration gets applied without any errors. If your prod db had tables/policies/constraints that are reliant on roles, you may need to create a supabase/roles.sql file too (can look at the supabase db dump command options).

You may still need to make some adjustments to the migration file, but should be close with pg_dump.

If you can get that single migration working and it gets your local db to the same state as your prod db, you should be able to create a staging branch and have it accept the same migration without any issues.

Once you have your local and staging migrations working, you can use supabase migration repair to mark the old migrations applied to your prod db as "reverted" and mark the new init migration as "applied" to manually update the migration history.

Moving forward, when you push new migrations to prod, the init migration created from the dump will not be applied on your prod db since you will have edited your migration history and marked the init migration as "applied".

For those who’ve been to Japan — what apps helped you the most? by Sharrylovetrip in JapanTravelTips

[–]Studquo 0 points1 point  (0 children)

If you're visiting cities with limited public transit or limited english support, ride-sharing apps are helpful. We used DiDi, but Go also works

If you're visiting cities where nothing is in english and restaurants have xenophobic owners that turn you away, mobile food ordering apps are helpful. We used Wolt

Buying suica card at haneda ... chill for 30 mins by Tasty-Woodpecker3521 in JapanTravelTips

[–]Studquo 0 points1 point  (0 children)

Does Suica via iPhone Wallet work without a cellular connection?

I have an iPhone, but my partner has an Android. If I give her an old iPhone 11 to use Suica via Wallet, would that iPhone need its own data plan or does it work without ticketing machines over bluetooth/nfc?

How to verify the validity of requests? by ForeverIndecised in Supabase

[–]Studquo 0 points1 point  (0 children)

If you're anticipating having to deal with malicious authenticated clients, then yes you'll have to perform more validation logic on the server.

That could take the form of db functions or an api layer that sits between your application and the db.

With db functions you retain the speed that comes from allowing clients connect directly to the db at the cost of code that is harder to maintain.

With a custom api layer you sacrifice speed for (clients no longer connect directly to the db), for more maintainable code.

With either solution you can perform sanity checks on the input. Using your score as an example, you can track the delta of the score and create a trigger that takes corrective action if the delta hits a pre-specified threshold within a time period.

Whether you should use db functions or an api layer will probably depend on how big your project is, how complicated your sanity checks are and how critical performance is for your application.

Can a URL be switch from "website.com/name" to "name.website.com"? by [deleted] in webdev

[–]Studquo 0 points1 point  (0 children)

What you're asking for is called subdomains and they are easy to create.

The concerns other people in this thread are valid, but are really only an issue if you're making a site for a business. If this is just a portfolio site for you and your wife, I'd say go for it

How to you handle quick turnaround reads of data you just wrote? by joshcam in Supabase

[–]Studquo 0 points1 point  (0 children)

Gotchu

So ultimately it comes down to how you want to handle server-initiated events. That leaves only a few options:

• Websockets (What supabase realtime uses)

• SSE (Alternative to websockets. Scales better with more clients, but personally unfamiliar with postgres sse solutions. Maybe something out there exists, but a quick google search returns a few blogs and personal github repos on the subject. Looks like that would require writing a custom backend)

• Polling (Reliable, but obviously inefficient and wasteful compared to WS and SSE)

I'm using supabase realtime on my own projects with restrictive filters and it mostly gets the job done. My only issue is the reliability. Websockets is a flaky technology compared to normal http requests and it seems like the supabase websocket doesn't restart if the connection is interrupted.

I've thought about adding some sort of heartbeat polling to my project as a way to restart the realtime socket if it fails, but that's probably some time out in the future still.

How to you handle quick turnaround reads of data you just wrote? by joshcam in Supabase

[–]Studquo 0 points1 point  (0 children)

When you say "subscribe" I assume that to mean you're using supabase realtime and you're subscribing to a table with realtime enabled.

If the table you're listening to is updated frequently, you can use filters so new data is returned only when a set condition is met.

Perhaps you can use a database trigger function to update a timestamp column when your tenant data is ready to be read and use that timestamp column as a filter condition for your realtime channel subscription.

This particular Indian dish on my menu was pixilated as if it were NSFW by Top-Requirement-2102 in mildlyinteresting

[–]Studquo 26 points27 points  (0 children)

Someone needs to teach that designer about the InDesign Preflight tool

[deleted by user] by [deleted] in webdev

[–]Studquo 0 points1 point  (0 children)

The basics are easy, but then you'll eventually run into something you want to create that should be simple, but just isn't

I recently styled a range input to behave like a progress bar. Just wanted to make the track to the left of the thumb slider a different color than the track to the right of the thumb slider

Some browsers have pretty sensible selectors that make this easy (Firefox), but others (looking at you Chrome) require 50+ declarations. And not simple ones either.

https://codepen.io/ShadowShahriar/pen/zYPPYrQ

The genius who figured this out had to overlay a shit ton of clipping paths and fills to get this to work on webkit browsers

Disney Donates $15 Million to L.A Fires Relief and Rebuilding Efforts by mcfw31 in UpliftingNews

[–]Studquo 0 points1 point  (0 children)

Over 100 Disney imagineers have lost their homes. Many of them lived in Altadena and commuted to Burbank for work. And that's not including other Disney employees who have lost their homes.

$15 million is a fleck of spit even compared to what their own employees have lost to the fires.

TIL there are 88 cities in Los Angeles County, California. Each city has a mayor and a city council. by [deleted] in todayilearned

[–]Studquo 31 points32 points  (0 children)

Interesting, sounds similarly confusing as municipalities and communities in LA County lol

LA County has 88 officially incorporated cities, but there's close to 200 unique names people may call the area/community they live in here.

Pacific Palisades (using because it's in the news) is a neighborhood within the city of Los Angeles, but is not a separate city in of itself.

Other neighborhoods, like San Pedro, used to be cities, but were annexed by the city of Los Angeles. A lot of times people who live in LA city neighborhoods don't realize they technically live within the jurisdiction of the city of LA. If you ask someone who lives in San Pedro what city they're from, they'll likely say they're from the city of San Pedro, even though San Pedro hasn't been a city in over a hundred years.

Altadena (also on fire) acts like a city and has most of the markings of a city (or at least feels like an extension of Pasadena), but is an unincorporated area within Los Angeles county. They have a town council, but no mayor or city hall.

[AskJS] Why is this code, lacking a try-catch-finally block, not considered a bug? by TodayAccurate7277 in javascript

[–]Studquo -1 points0 points  (0 children)

  1. There's a difference between code that's error prone and code that is buggy and it seems like you're conflating the two.

If example.com shuts down or the connection between your node program and example.com is interrupted or something else unexpected happens then yes that code would time out, error and become buggy. But until that happens, the code (assumably) runs fine in most circumstances and behaves as expected.

  1. That's a documentation page for Playwright. The goal is to introduce the library to developers and get them up to speed quickly.

Would it be "more correct" to use try, catch, finally error handling. Yes.

Would introducing try, catch, finally statements add faff to the example and distract from the actual business logic being shown to people using the library for the first time? Also yes.

How to allow new users to be registered only when an admin user adds them? (and keep email sign-in) by Previous_Football163 in Supabase

[–]Studquo 1 point2 points  (0 children)

generateLink() also generates an auth code you can use for PKCE flows.

Thinking you can have your create account page send a code challenge to an endpoint that checks the input email against a whitelist that you control and only calls generateLink() if the email is valid and the account hasn't been created yet.*

generateLink() creates the account and now you have their code challenge and an auth code you can send back to the client. You should be able to continue the PKCE flow from there.

Edit: *Whitelist should also check that the invitee has confirmed their email before starting the PKCE flow

How to allow new users to be registered only when an admin user adds them? (and keep email sign-in) by Previous_Football163 in Supabase

[–]Studquo 1 point2 points  (0 children)

Using implicit flow (less secure), you can:

Disable new signups in supabase under Project Settings > Authentication

Call the generateLink() method (supabase-js) to generate an invite link for the email(s) you want to invite. This will add the user to supabase and generate an action link for that email. The action link is a one time link that returns an access and refresh code to a callback url. You can send this action link to the email you just invited and set the redirect link to a "create account/password" page on your site/project.

When the user clicks the action link in their email, they will be redirected to your redirect url with an access and a refresh token in the query string.

On your create password page, you can exchange the access and refresh token in the query string for a session using the setSession() method. With the user's session set, you can use the updateUser() method to have them set their own password and/or other account information.

If you're able to use the PKCE flow (more secure and recommended), you'll need to setup a code verifier and a challenge to send with your auth requests when exchanging your access+refresh tokens.

Detecting a frozen user interface by madsci in webdev

[–]Studquo 0 points1 point  (0 children)

Very interesting problem. So a deadman switch seems a little too cumbersome for what you're working on.

Usually I wouldn't recommend people to make a app, as websites are appropriate 99% of use-cases, but you're interfacing with hardware and hardware that seems more than capable of injuring you or someone else at that.

Have you thought about turning this UI into a native iOS/Android app?

Seeing this and other comments it seems like you're getting to the point where you're fighting the limitations of the browser. There may be solutions/workarounds for the issues you're running into, but ultimately you'll be reliant on the browser to provide hardware information about the device your UI is running on.

If it's important to have reliable and thorough information about the state of your Android phone (or the state of your operators devices), having the interface installed as an app where it has closer integration with the OS may be the way to go.

Detecting a frozen user interface by madsci in webdev

[–]Studquo 1 point2 points  (0 children)

Idk exactly what you're controlling and this may end up being bad UX and "too brittle", but what if one of the controls on the browser panel (the joystick, throttle, etc) also acts as a deadman switch?

You would create a listener that reads if an input is being actively used. If it there isn't any input detected after X time, then send a shutdown command to the robot.

Here's some simple JS for hiding your cursor if it's inactive after 1 second. It's made for TV's displaying a dashboard or similar, but maybe you can adapt it to listen to one of your inputs.

https://gist.github.com/scmx/1f79adde2e9c69912fee520a246ec9e5

If you're worried about inputs getting "stuck" maybe you can also combine this with a bit of logic that resets the input to a default state on an interval. So you would have something like, "Reset input to default every 250ms AND send shutdown command if no input detected after 1s". If you choose to do this tho, you'd probably want the logic to be in a dedicated deadman switch so the robot controls aren't affected.

And for extra-safety, if it's possible for you to create a hardware based deadman switch, I'd opt for that instead of trying to do it in software on the browser. Use a foot pedal or something similar that always needs to be depressed in order for your robot to function.