News for hackers. Stuff that matters.

maxdeviant

Re:Zed AI on Tuesday August 20, 2024 @08:12PM (#41305430)
Thanks for the report, this should be fixed now!
Re:Zed, a collaborative code editor, is now open source on Wednesday January 24, 2024 @04:38PM (#39122936)
We've adjusted it so that the CLA can now be viewed without signing in.

Sorry about that!

Re:Ask HN: Programs that saved you 100 hours? on Monday April 13, 2020 @05:41PM (#22860409)
I'm not familiar with Keycloak. I glanced at their docs briefly, and it looks like Keycloak manages your users for you?

WorkOS only handles SSO, so all of our users are still stored in our own database. This is one of the big reasons we went with WorkOS as opposed to something like Auth0 or AWS Cognito.

Re:Ask HN: Programs that saved you 100 hours? on Sunday April 12, 2020 @04:34PM (#22850850)
WorkOS (https://workos.com/) if you need to support single sign-on (SSO) for your app.

SSO is free, and they offer other enterprise-focused features, like directory sync and audit trails.

Re:Secure by Design on Tuesday March 24, 2020 @05:15PM (#22679082)
Yes. This is exactly what we do at work.

It makes sure that you never pass a `LocationId` where a `UserId` is expected; the type system literally will not allow it.

Re:Why functional programming matters (1990) [pdf] on Saturday November 09, 2019 @08:37AM (#21491450)
You can also use Fable (https://fable.io/) to compile F# to JS.
Re:Show HN: Darklang on Monday September 16, 2019 @03:33PM (#20987738)
Dark looks really cool. When I heard about it before my initial reaction was a huge "nope", but after watching the videos I'm curious to try it out.

It's amazing just how little friction there is for you to get an API endpoint backed by a datastore up and running. That being said, there are a bunch of unknowns. Having my entire application, even down the language it's implemented in, being proprietary is a little scary.

Will definitely be looking forward to playing around with this. Just as soon as I get my signup email ;)

Re:Semantic Validation in Rust on Thursday September 05, 2019 @02:35PM (#20889533)
The problem I have with this style of validation is that it doesn't "make illegal states unrepresentable". If the validation is not run then it is still possible for instances of `ContactData` that violate the business rules to enter the system.

  > Our reservation business requires that contact data entities are only accepted if all of the following conditions are satisfied:
  >
  > - The e-mail address is valid
  > - The phone number is valid
  > - Either e-mail address, or phone number, or both are present
In this case, all of the above rules can be encoded into the type system itself. Here's how I would approach this particular problem:

  struct PhoneNumber(String);
  
  impl PhoneNumber {
      fn new(value: String) -> Result<Self, ValidationError> {
          if is_valid_phone_number(value) {
              Ok(Self(value))
          } else {
              Err(ValidationError)
          }
      }
  }
  
  struct EmailAddress(String);
  
  impl EmailAddress {
      fn new(value: String) -> Result<Self, ValidationError> {
          if is_valid_email_address(value) {
              Ok(Self(value))
          } else {
              Err(ValidationError)
          }
      }
  }
  
  enum ContactData {
      PhoneOnly(PhoneNumber),
      EmailOnly(EmailAddress),
      PhoneAndEmail {
          phone: PhoneNumber,
          email: EmailAddress
      }
  }
This approach, when applied alongside Rust's modules and visibility modifiers, would make it impossible for any of these types to be in an invalid state.
Re:Ask HN: 2018 resolutions? on Monday January 01, 2018 @09:45PM (#16049466)
Here is what I'm going to focus on in 2018:

- Work less, achieve more

- No alcohol

- Read more

- Write more

- Practice my Mandarin

- Produce 1 song/week (https://weeklybeats.com/)

- Continue to make one thing every day

Re:Ask HN: What programming language you will learn in 2018? on Monday January 01, 2018 @04:48PM (#16048238)
F#
Re:HN: List of April Fools' Day Announcements (2017) on Friday March 31, 2017 @05:51PM (#14008639)
Goodbye JavaScript: Introducing our CSS API Client (https://blog.algolia.com/js-is-dead-all-hail-css/)
Re:Ask HN: Where do you host your personal blog these days? on Saturday March 18, 2017 @12:59AM (#13899966)
My site is written in React + Next.js (https://github.com/zeit/next.js/) and hosted on now (https://zeit.co/now).
Re:Why is routing so complex? on Saturday December 10, 2016 @02:01PM (#13147246)
React Router v4 places a greater emphasis on splitting up your routes, as opposed to keeping them all in one spot [1].

It also allows you to do really cool stuff like in their recursive routing example [2].

[1]: https://react-router.now.sh/basic

[2]: https://react-router.now.sh/recursive-paths

Re:Why most “clever” code ain’t so clever after all on Tuesday July 12, 2016 @11:32PM (#12083734)
You can use composition to reduce boilerplate as well. Composition > inheritance is something that is emphasized greatly in the React community.
Re:Ask HN: Static site generator with web UI? on Tuesday March 24, 2015 @06:15PM (#9259877)
Your solution sounds like exactly what I need!

Currently upgrading my company's existing website, and was looking into WordPress as a CMS. The security concerns and the resource costs of using WordPress were key detractors, but this sounds like it could be the answer for us as well.

Re:Request: Open source the Hacker News front-end code on Friday February 13, 2015 @03:13PM (#9046902)
There is a HN clone (https://github.com/arclanguage/anarki/blob/master/lib/news.a...) written in Anarki, which is a community fork of Arc.
Re:HN. Let's share Twitter accounts on Thursday July 10, 2014 @11:37PM (#8018768)
Generally nerdy tweets and mini-rants about stupidity: https://twitter.com/maxdeviant
Re:Ask HN: What are you learning right now? on Wednesday June 18, 2014 @08:43PM (#7913801)
Was this with any prior experience with the language?
Is this traceable in any way?

Because my college campus seems like the perfect place to test it out for a little induced chaos, but I'd rather not get in trouble with the network admins.