Better HN
topnewbestaskshowjobs
Log inSign up

moretti

107 karma · joined Feb 7, 2014 (12y ago) · 48 submissions

Submissions

comment 3w ago · link · parent

Can someone build this?

Show HN: HackerHype - an aggregator for every Hacker* aggregator

  HackerHype
  ├── HackerTube → videos recommended on HN
  ├── HackerBooks → books mentioned on HN
  ├── Wikihack → Wikipedia articles mentioned on HN
  ├── HackerHack → posts posted on HN
  └── ...

comment 1mo ago · link · parent

Does opencode support anything similar to claude code's auto mode (https://code.claude.com/docs/en/permission-modes#eliminate-p...)?

I'd like to switch to opencode, But "yolo mode" feels risky and manually approving every command the model runs kills the flow

comment 8mo ago · link · parent

Thanks to the Vite team for building a faster, modern bundling solution on a fully open source stack that isn't tied to a specific framework...cough cough, Turbopack

comment 4y ago · link · parent

It looked okay until I scrolled down to the browser compatibility table and had to tilt my head to read the vertical text

comment 5y ago · link · parent

Can anyone confirm if the final build number is the same as 12.0.1 RC2 (21A559)? You can run `$ sw_vers` from the CLI to check it.

comment 5y ago · link · parent

I use Copilot mostly as replacement for intellisense and macros. It helps me automating repetitive tasks. I would never trust Copilot for an algorithm or a snippet, I mean I would treat the code just like anything taken from StackOverflow or Github.

comment 5y ago · link · parent

yarn 2 solved real problems with zero install and advanced PnP. Maybe the only problem was that it was released too early, wasn't mature enough when it came out. Now it's just better than v1 and npm, works particularly well on large mono repos where upgrading a package can often break other modules due to how node_modules hoisting works.

comment 5y ago · link · parent

it has a microSD card slot: https://www.steamdeck.com/en/tech

comment 6y ago · link · parent

They slow down the phone after an unexpected shutdown, when the battery is unable to deliver the necessary peak power.

comment 8y ago · link · parent

By declaratively I mean that in React you typically declare how an element should be render given the current (props, [state]).

For example, in vanilla JS, you might have something like:

  const btn = document.createElement('button');
  btn.className = 'btn red';
  btn.onclick = function(event) {
   if (this.classList.contains('red')) {
     this.classList.remove('red');
     this.classList.add('blue');
   } else {
     this.classList.remove('blue');
     this.classList.add('red');
   }
  };

In React instead:

  class Button extends React.Component {
    state = { color: 'red' }
    handleChange = () => {
      const color = this.state.color === 'red' ? 'blue' : 'red';
      this.setState({ color });
    }
    render() {
      return (<div>
        <button 
           className=`btn ${this.state.color}`
           onClick={this.handleChange}>
        </button>
      </div>);
    }
  }
I find it simpler to understand, because render, given its state, describes exactly how the UI should be.

comment 8y ago · link · parent

It’s interesting that you find this “simpler”. One of the great advantages of React is that is declarative, it’s easy to understand how a component will render given a set of (props, state). Your example is quite the opposite, the render method violates this principle and each event handler manipulates the DOM using a ref. I’d call this spaghetti-React.

comment 9y ago · link · parent

Redux is not an implementation of Flux. These two blog posts explain the main differences: https://code-cartoons.com/a-cartoon-guide-to-flux-6157355ab2... https://code-cartoons.com/a-cartoon-intro-to-redux-3afb77550...

comment 10y ago · link · parent

This is also a really good resource: https://github.com/thejameskyle/the-super-tiny-compiler

comment 10y ago · link · parent

https://twitter.com/domenic/status/721796970197684224

comment 10y ago · link · parent

I'm not a number, I'm a free man!

16.

A cartoon guide to Facebook's Relay (part 1)(code-cartoons.com ↗)

1 points · by moretti · 10y ago · discuss

comment 10y ago · link · parent

Yeah https://twitter.com/sindresorhus/status/669958889941639168

comment 11y ago · link · parent

In npmcdn the author of the package has to manually include the UMD build of the library.

comment 11y ago · link · parent

You still have to simulate named arguments with an object:

    const foo = ({ a = 2, b = 2, c = 3 } = {}) => a * b * c;
    const dict = {b: 4, c: 6};

    foo(); // 12
    foo(dict); // 48

comment 11y ago · link · parent

Reminds me of this tweet:

https://twitter.com/capotej/status/647213485294616576

21.

The Redis community is moving to Reddit(reddit.com ↗)

3 points · by moretti · 11y ago · 2 comments

22.

A cartoon intro to Redux(code-cartoons.com ↗)

2 points · by moretti · 11y ago · discuss

comment 11y ago · link · parent

You're probably not familiar with Atwood's Law[0]:

> Any application that can be written in JavaScript, will eventually be written in JavaScript

[0]: http://blog.codinghorror.com/the-principle-of-least-power/

comment 11y ago · link · parent

Cool, that looks really interesting...

comment 11y ago · link · parent

Embed CSS on any website! ;-)

How do you specify npm dependencies. Does it "automagically" inspect your `require` statements?

comment 11y ago · link · parent

So Safari is holding back webdev because it doesn't support an experimental technology?

Fun thing: the author of the Selection API draft works for Apple :-)

http://www.w3.org/TR/selection-api

12