Hacker News new | past | comments | ask | show | jobs | submit | more sarahdellysse's comments login

I recently picked up a Linksys e8450 (twin sibling of the Belkin RT3200) and flashed it with openWRT and it's been great; WIFI-6 speeds on a router that is actually configurable


even simpler, I have always wished that JSX/JSX-alikes would serialize to something like a tuple like `(tag: string | Component, attributes: Record, children: List)`, so your example would start looking something like this:

    <div class="example">
      <h1 id="heading">This is an example</h1>
      <h2>creating React markup</h2>
      <AnotherComponent foo="bar">
        <li>
          <a href="http://whatever.com">One list item</a>
        </li>
        <li>
          Another list item <hr />
        </li>
      </AnotherComponent>
    </div>
would translate to something like this:

    ["div", {"class": "example"}, [
      ["h1", {"id": "heading"}, ["This is an example"]],
      ["h2", {}, ["creating React markup"]],
      [AnotherComponent, {"foo": "bar"}, [
        ["li", {}, [
          ["a", {"href": "http://whatever.com"}, ["One list item"]],
        ],
        ["li", {}, [
          "Another list item",
          ["hr", {}, []],
        ],
      ],
    ]
and that all Rux/JSX/hyperscript/whatever would compile down to that


Ruby has blocks, so in Phlex, you’d write it like this using methods and keyword arguments.

  div(class: "example") do
    h1(id: "heading") { "This is an example" }
    h2 { "creating React markup" }
    AnotherComponent(foo: "bar") do
      li { a(href: "http://whatever.com") { "One list item" } }
      li do
        text " Another list item"
        hr
      end
    end
  end


You’re halfway to Clojure’s hiccup syntax[1] there.

[1]: https://github.com/weavejester/hiccup/blob/master/doc/syntax...


"JSX-inspired" caught me off gaurd, the only thing JSX could inspire me to do was build something so I never had to touch it again, I landed on something similar to what you have here, I call it "Elementary"

Here's the JSON for a landing page written in my syntax: https://github.com/jazzyjackson/lookalive/blob/master/docs/i...

In another project I use it extensively to mix javascript in with the object syntax as you would with JSX: https://github.com/lookalive-software/geodesy/blob/newfocus/...

The implementation is fairly simple, given JSON returns an HTML string.

https://github.com/lookalive-software/elementary/blob/master...


    input: Record<string, unknown>


Thank you. That gives me a red underline under ContactId and Email now. I think because input.Contact__c and input.ContactEmail__c are unknown. I think this is the right direction. What is my next step?

    const myOutput: Output = {
        ContactId: input.Contact__c,
        Email: input.ContactEmail__c,
        IsInternalUpdate: true,
        Preferences: mypreferences
    }
(property) Output.ContactId: string Type 'unknown' is not assignable to type 'string'.ts(2322) Output.ts(4, 5): The expected type comes from property 'ContactId' which is declared here on type 'Output'


this is really interesting and something I hadn't thought about. Could you provide some examples? I wanna look more into this


ExOfficio men's underwear is my go-to brand.


Back when I worked at OmniTI (from like 2015 to 2017), we had an in-house Illumos neé Solaris distro for cloud servers named OmniOS. I didn't use it too much myself as it was somewhat legacy but all the other devs who used it for prod debugging loved all the dtrace/zfs stuffs on it.


LOL, small world. I was at OmniTI from '10-'13; I was around for the transition from Solaris 10 to OmniOS. It was an interesting system and I do wish the rest of the freenix world would learn some of the lessons that could be learned from it. (I guess in fairness they're starting to re: openzfs, ebpf, some of the smarter service management tools, et al.) That was the last time I touched proprietary unix at work, though. Even working at Oracle's AWS competitor later, everything internally was Oracle Enterprise Linux (which is to say, RHEL with the serial numbers filed off).


I wouldn't call that proprietary. It was freely available, and I worked with it for a bit, until switching that project to SmartOS, which is also... not proprietary.

Both were excellent systems to work on in dev and prod.


Pobox also had a few racks of hardware running Illumos/SmartOS as parts of their older stack. it was a pleasure to use once I wrapped my head around it, which was little enough because it was so reliable.


I use OmniOS - its actually not that rare to use if you want a good ZFS server. I am about to do a fresh install on new hardware of it as well. Its not legacy at all.


So say we had code like this:

  const safeSplice = (items, start, deleteCount, ...itemsToAdd) => {
    const copy = [...items];
    const deleted = copy.splice(start, deleteCount, ...itemsToAdd);
    return {
      deleted,
      list: copy,
    };
  };
We could put this as a jsdoc-style typescript comment just before the `const safeSplice` line:

  /** @type {<Item>(items: Array<Item>, start: number, deleteCount?: number, itemsToAdd?: Array<Item>) => { deleted: Array<Item>, list: Array<Item> }} */
or as a multi-line type declaration:

  /** @type {<Item>(
    *   items: Array<Item>,
    *   start: number,
    *   deleteCount?: number,
    *   itemsToAdd?: Array<Item>
    * ) => {
    *   deleted: Array<Item>,
    *   list: Array<Item>
    * }}
    */
Alternatively, you could do something like this in place of the above:

  /*
   * @template Item
   * @param {Array<Item>} items
   * @param {number} start
   * @param {number} [deleteCount]
   * @param {Array<Item>} itemsToAdd
   */
I started out doing the former because I liked using the typescript notation, but I ended up doing the latter more often as I could leave the return type off the signature, which I prefer to do


This is really cool! TIL. At this point though, I feel like you might as well just use Typescript, no? You’ll get more features / tooling and cleaner syntax. I’m intrigued to learn more about advanced JSDoc now though, if anything to be more prepared if I’m ever forced to work with it in the future.


Oh wow, this is great! I have tried other window-based application switchers but never really liked how they worked. I understand that macOS has a app-centric model but I find that switching between windows works so much better for me.


I add the TOTP to my 1Password vault, I try not to use SMS for 2FA. That said, I should start keeping a list of all my accounts that _require_ SMS for 2FA


I do the same thing with 1Password. I also created a 1Password label/ tag “sms_2fa” that I throw on all the accounts that required it.

Helps keep track of potential weak spots and it’s easy to go through once a year and see if things have improved


In my segment of reality-as-we-know-it, "2FA" _always_ means "SMS."


`fish` is amazing. I used to have a big old dotfiles repo, but nowadays I add starship[0] to my env and I'm pretty much good to go.

On the non-interactive scripting front, I've found fish to be a very competent language for it, but you're right, the error handling (among other things) are lacking compared to "real" languages

[0]: https://starship.rs


I have to say, I use fish and I customize my prompt... is starship really necessary? I recognize starship is cross-shell, but if I standardize on installing fish on my machines, I'm not sure I need that feature.

Is there a "killer app" for starship that you can't get from writing out your prompt in a fish shell script?

Here's mine: https://github.com/maximum-ethics/linode-caddy/blob/master/r...

It's a 3-line prompt with a timestamp on the first line, my username@host + pwd on the 2nd line, and the actual prompt with the cursor on the 3rd line. I'm now considering swapping the timestamp to the right side after that possibility was mentioned in other comments in this thread.


I’ve been using fish for years and I love it. I have a simple prompt and a few functions that I share between all of the environments I have.


I've had this experience as well. My zsh config was a monster. fish was extremely easy -- starship and ready to go.


I looked at it when it first came out but not since, does it have a typescript debugger yet?


Yup, via LSP just like Visual Studio Code.

There were a couple quirks in the early days but it improved at a rapid clip.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: