News for hackers. Stuff that matters.

ianjsikes

You can still use VS Code's diff if you have the GitHub Pull Requests extension: https://marketplace.visualstudio.com/items?itemName=GitHub.v...
Barrier is almost perfect for my use, with one big flaw. It has no concept of individual displays. For most setups, it probably isn't a big deal. For me, I am back to a hardware KVM.
Re:A Modern JavaScript Tutorial on Tuesday December 08, 2020 @10:11AM (#25346167)
The cheaty way is `let copy = JSON.parse(JSON.stringify(val))`. Doesn't work for functions or cyclic structures though.
Re:AMD Zen 3 Ryzen Deep Dive Review on Thursday November 05, 2020 @01:57PM (#25000857)
I'm in a similar situation and i'm going with a 5900x FWIW. The 5950 feels a little overkill, I don't expect to be fully taking advantage of the extra cores.
Re:Android 11 on Tuesday September 08, 2020 @02:18PM (#24411168)
Wow, the bubbles feature is really interesting. They standardized Facebook Messenger's chat bubbles (the best part of Messenger imo). Pretty awesome to be able to have chats from many different apps accessible in the bubbles.
Actually it was pretty easy to find a paper on that exact subject by the same authors.

https://www.iza.org/publications/dp/13388/black-lives-matter...

> "we find no evidence that urban protests reignited COVID-19 case growth during the more than three weeks following protest onset. We conclude that predictions of broad negative public health consequences of Black Lives Matter protests were far too narrowly conceived."

Re:Bye, Amazon on Monday May 04, 2020 @11:55AM (#23069518)
And yet wage theft (by employers) seems to be the largest form of theft in the US by far. Is it really a wonder that people would steal / slack off when they are so consistently getting screwed at their workplace?

https://www.nelp.org/wp-content/uploads/2015/03/BrokenLawsRe...

https://www.deseret.com/2014/6/24/20543670/wage-theft-how-em...

Re:How to play board games online with your friends on Friday April 24, 2020 @11:41PM (#22975352)
I am working on a little clone of One Night Ultimate Werewolf using Phoenix LiveView. It has been working out great for me so far.
Re:Show HN: Build your own Vim emulation for VS Code on Friday February 21, 2020 @04:47PM (#22387182)
That would be really interesting to me. I have been eyeing Kakoune for a while and love the idea but I'm too invested into VS Code to completely switch editors.
Re:Magic Mushrooms Can Help Smokers Kick the Habit on Wednesday October 16, 2019 @12:06PM (#21271911)
Are you... comparing psilocybin to heroin?
> Seems intuitive that if parseInt allows omitting the radix parameter, that it should default to whatever radix a standard integer primitive would default to.

But in this case, the radix is _not_ omitted. The map function passes the index of the current iteration as the second parameter to the function it is passed. It is kinda like this: ``` ['1','7','11'].map((item, index) => parseInt(item, index))

Re:JLua: Yet another Lua implementation in JavaScript on Saturday May 25, 2019 @03:14PM (#20010702)
1. The "index.js" thing is due to how module resolution is handled with CommonJS and ES modules. If you have a file at "./lib/index.js", then you can omit the "index.js" and just write "require('./lib')" from another file.

2. Not exactly. In JS, every file with an "import" or "export" statement somewhere is its own module.

3. You can write code like this for the browser. Most browsers support ES modules now. However, you do need a bundler tool like Webpack if your code depends on other node modules.

Just wanted to mention that React Native + React Native Web _is_ a viable solution (at least for me it was). I was able to convert a mobile React Native project into a usable mobile website with Next.js and `react-native-web`.

I had to use a lot of platform-specific imports (eg: `index.ios.tsx`/`index.web.tsx`) to replace anything mobile-specific, and there are some cases where you need platform-specific UI components as well to make everything look nice on larger screens.

My only complaint is it gets a bit messy having all these different entry points and platform-specific modules and whatnot. Overall, it's probably the best you can hope for to write an app for mobile + web with ~80-90% _actual_ code sharing.

Re:Content-aware image resize library on Wednesday January 31, 2018 @12:59AM (#16271807)
Better yet, scale the image proportionally down to the largest of the two target sides, then run the algorithm once in the direction that needs to shrink.
Here's a great VS Code extension that shows package size inline next to your import/require statements:

https://marketplace.visualstudio.com/items?itemName=wix.vsco...

Re:How we run NPM packages in the browser on Saturday October 07, 2017 @11:07PM (#15426798)
What's so funny? Yarn uses the npm package registry, so it is a package manager for npm.
Re:Get Started with Rust, WebAssembly, and Webpack on Tuesday June 27, 2017 @02:01PM (#14647663)
That is a great idea. I expect more usability improvements to come shortly as more people become interested in WebAssembly.
Re:Get Started with Rust, WebAssembly, and Webpack on Tuesday June 27, 2017 @01:43PM (#14647515)
Author here. It is my cursory understanding that the Emscripten SDK handles converting types to and from Javascript values and C-like data in the module's virtual memory. I'm not totally sure how that conversion is happening yet. I can tell you that when I pass a string when it expects an i32, it treats it as 0, so `add("foo", "bar") -> 0`
Re:Get Started with Rust, WebAssembly, and Webpack on Tuesday June 27, 2017 @01:09PM (#14647185)
Hi, author here. Thanks for the tip, I wasn't aware compiling with Emscripten would work on stable. That should simplify the process. I'll do some more research and update the guide.