HNHacker News
TopNewBestAskShowJobs

moretti

107 karma · joined February 7, 2014

submissionscomments
moretti··on Show HN: HackerHack – HackerBooks but for Posts Posted on HN
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
  └── ...
moretti··on OpenCode 2.0
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

moretti··on Vite 8.0 Is Out
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
moretti··on MDN Redesign
It looked okay until I scrolled down to the browser compatibility table and had to tilt my head to read the vertical text
moretti··on macOS Monterey
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.
moretti··on GitHub Copilot Generated Insecure Code in 40% of Circumstances During Experiment
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.
moretti··on Yarn 3.0
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.
moretti··on Valve Steam Deck
it has a microSD card slot: https://www.steamdeck.com/en/tech
moretti··on France fines Apple €25M for iOS software that slowed down older iPhones
They slow down the phone after an unexpected shutdown, when the battery is unable to deliver the necessary peak power.
moretti··on Removing jQuery from GitHub.com frontend
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.
moretti··on Removing jQuery from GitHub.com frontend
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.
moretti··on How to optimize React applications that use Redux
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...
moretti··on How to implement a programming language in JavaScript
This is also a really good resource: https://github.com/thejameskyle/the-super-tiny-compiler
moretti··on Bublé: a fast, batteries-included ES2015 transpiler
https://twitter.com/domenic/status/721796970197684224
moretti··on We Need a New Username System
I'm not a number, I'm a free man!
moretti··on Atom text editor 1.4 released
Yeah https://twitter.com/sindresorhus/status/669958889941639168
moretti··on Show HN: Jsbundler – Bundle npm packages and use them in the browser
In npmcdn the author of the package has to manually include the UMD build of the library.
moretti··on Node.js 5.0 Released
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
moretti··on Pivotal Greenplum Database has been open sourced
Reminds me of this tweet:

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

moretti··on React Desktop – React UI Components for OS X El Capitan and Windows 10
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/

moretti··on Embed Node.js on any website
Cool, that looks really interesting...
moretti··on Embed Node.js on any website
Embed CSS on any website! ;-)

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

moretti··on Clipboard.js: Modern Copy to Clipboard
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

moretti··on Goto in Python
Here's another Python 3 compatible implementation: https://github.com/cdjc/goto
moretti··on Relay: Declarative data for React applications
Actually, if you leave off the "new" you get a TypeError:

    TypeError: Class constructors cannot be invoked without 'new'
moretti··on Modals in React
How a polymer component would be better than a react component?
moretti··on Modals in React
Exactly, and you can't simply set a left margin because the scrollbar width is different in every OS. This is what bootstrap does: https://github.com/twbs/bootstrap/blob/83bfff7f0765503b990b9...
moretti··on Dragula: Simple drag and drop
http://www.quirksmode.org/blog/archives/2009/09/the_html5_dr...
moretti··on Here’s Waldo: Computing the optimal search strategy for finding Waldo
Related: http://stackoverflow.com/questions/8479058/how-do-i-find-wal... http://stackoverflow.com/questions/8849869/how-do-i-find-wal...
moretti··on Comparison of CSS in JavaScript Libraries for React
Here's another great comparison: https://github.com/MicheleBertoli/css-in-js

I think that css-modules (implemented in webpack's css-loader) is the sanest approach: https://medium.com/seek-ui-engineering/the-end-of-global-css...

Page 1 of 2Next →