News for hackers. Stuff that matters.

uwu

Re:Tell HN: Exercise caution with links to archive sites on Monday March 14, 2022 @06:16AM (#30670562)
the top-fwz1 script is mail.ru's statistics counter

https://top.mail.ru/help/en/rating

> Top Mail.Ru is a statistics system for site owners. You need to get and install the counter code on the pages of your site to collect data.

you can see the same code snippet that's on archive.ph here: https://top.mail.ru/help/en/code/receive

Re:RFC 3339 vs. ISO 8601 on Sunday October 24, 2021 @04:24PM (#28981533)
chrome's extension api for downloads has the same limitation

filenames that are reserved names on windows (like NUL) or contain characters that are reserved on windows are refused with "Invalid filename", even on platforms and filesystems that don't have the same limitations

this might be desirable for enforcing portability in extensions, but the thing isn't mentioned in the documentation[1] for the api so you had to know about it beforehand (like most extension devs, probably) or find out the hard way when some of your downloads unexpectedly fail (like me)

i was using it on linux in a personal extension i wrote, and i thought it was silly that i had to add extra code to further sanitize and mangle the filenames for an OS i don't even use

[1] https://developer.chrome.com/docs/extensions/reference/downl...

Re:Twitter internal panel linked to account hijackings on Friday July 17, 2020 @09:00AM (#23869992)
uwu
Re:The 5.7 kernel is out on Monday June 01, 2020 @06:30AM (#23377058)
*GNU/Linux kernel
Re:BOLT: Binary Optimization and Layout Tool on Sunday March 22, 2020 @12:03PM (#22655959)
similar thing from google: http://lists.llvm.org/pipermail/llvm-dev/2019-September/1353...

> Inspired by the performance gains and to address the scalability issue of BOLT, we went about designing a scalable infrastructure that can perform BOLT-like post-link optimizations.

> Our experiments on large real-world applications and SPEC with code layout show that Propeller can optimize as effectively as BOLT, with just 20% of its memory footprint and time overhead.

Re:Programming Fonts – Test Drive on Monday January 21, 2019 @09:04AM (#18960415)
from wikipedia:

> The DejaVu fonts are modifications of the Bitstream Vera fonts designed for greater coverage of Unicode, as well as providing more styles.

Re:GCC 8 Link Time and Interprocedural Optimization on Tuesday June 19, 2018 @06:58AM (#17345453)
when i was a full-time hobbyist webdev i was surprised when i learned c compilers don't do whole-program optimization by default but limit themselves by optimizing each translation unit separately (i guess it makes things simpler)

you can get "LTO" in javascript by using a minifier together with something like webpack which can inline modules when it's safe to do so (instead of putting them in functions that are called by the module loader and can't be minified away), so i assumed "real" compilers must do that stuff a lot better with the language being less dynamic

Re:LR Parsing: More Elegant Than You Think on Monday June 04, 2018 @07:37PM (#17233664)
the font loader script is causing it to never load for me

i run latest chrome with the --disable-remote-fonts command line option

Re:Node v10.0.0 Released on Tuesday April 24, 2018 @04:39PM (#16916349)
you've misunderstood, it just emits a warning for using the Buffer constructor which is deprecated in favor of Buffer.from and others[1]

it's limited to code outside of the node_modules folder to prevent dependencies from triggering an unactionable message

[1] https://nodejs.org/api/buffer.html#buffer_new_buffer_array

> I wish chrome added an option for tampermonkey scripts to be run with disabled js, that would make this solution perfect.

that's up to tampermonkey but maybe it's possible that google wouldn't like it since it would let userscripts access extension apis

what tampermonkey does is inserting the script into the page in a script tag to isolate it from the extension[1] and let it access variables defined by scripts on the page, but if scripts are blocked on the page it just doesn't run

i made my own custom js manager (with no userscript api support) that lets you choose if the script should be ran in the extension or page context (defaults to extension which works with scripts blocked) but i don't know if it's in good enough state to put on the internet and i've never really made things for anyone but myself

[1] https://developer.chrome.com/extensions/content_scripts#exec...

browser zooming doesn't work on the site (seems like it's caused by using viewport-relative units in css for the font size)
Re:GitHub Desktop 1.0 on Tuesday September 19, 2017 @03:00PM (#15287771)
> heavy and feels like a website rather than an app

the electron app is noticeably faster than the old client for me (on windows)

electron probably also means it'll be easier for them to add features in the future

Re:GitHub Desktop 1.0 on Tuesday September 19, 2017 @01:30PM (#15286729)
am i using the same clients as everyone here or do people just like complaining about electron at every opportunity?

the new client is actually much faster for me, it starts up faster (1.5s to show the gui fully loaded vs 4s to show the gui and another 3s to finish loading what's on the screen) and there's no lag when using it (unlike with the old client)

i also prefer the new ui, i find it to be clearer than the old one

Re:Ask HN: What would you change about JavaScript if you could? on Thursday September 07, 2017 @10:02PM (#15197375)
not a change to an existing thing but i have a feature idea: variables that aren't initialized until the first time they're accessed

  textarea.onkeydown = event => {
  
    // doesn't get the properties until they're accessed
    const get {selectionStart, selectionEnd, value} = textarea;
  
    // doesn't actually call .slice yet
    const get selectedText = value.slice(selectionStart, selectionEnd);
  
    // ...
  
    if (event.key === "Enter") {
  
      // initializes selectedText
      console.log("selected text: " + selectedText);
  
      // uses the same value, doesn't reinitialize it
      selectedText;
    }
  };
Re:Show HN: JavaScript lib to read tags from audio formats on Monday August 21, 2017 @10:54AM (#15065022)
the title made me expect more than a 31-line node.js wrapper for ffprobe
Re:When to Use Arrow Functions with React on Friday August 18, 2017 @12:38PM (#15047679)
> However, if you’re using Babel (or create-react-app) to build your source, you have another option: setting arrow functions as class fields (or arrow function methods).

> This gives you the best of both worlds. You get the improved performance from only defining functions once, but you still get the simple method-like syntax.

i think this is wrong because class fields are evaluated in the constructor

i dislike the class fields proposal because it's confusing (as shown by the article) and adds little value (can already use a constructor) and lets you sprinkle the fields all over the class definition instead of having them in one place (the constructor)

also, how it makes own properties instead of prototype properties which would be consistent with how methods are already defined in the class body

only the static fields part of the proposal is good because it's useful (there's no constructor for static fields) and behaves as expected (no "own property vs prototype property" question to get wrong)

Re:uBlock Origin Maintainer on Chrome vs. Firefox WebExtensions on Wednesday August 09, 2017 @08:16PM (#14975066)
chrome has a setting to block scripts and it lets you add exceptions for sites

it's also easy to access: http://cdn2.ubergizmo.com/wp-content/uploads/2012/11/site-in...

i wish firefox came with something similar

Re:Can I do FP in my language? on Saturday August 05, 2017 @02:56PM (#14937267)
you forgot to say what's bullshit about it
i actually got it from https://wtfjs.com/ which was linked in another comment

someone explained how it works here: https://news.ycombinator.com/item?id=14891850

> Object.create(Array).length === 1 //true

it bothers me how the examples are often misleading or just misusing language features but people who don't know the language will gladly agree with them and have their "js sucks" belief reinforced

Re:Avoid these common JavaScript mistakes on Thursday July 27, 2017 @08:34AM (#14864649)
> 1. Not Adding Semi-Colons

nice

> But to deal with a really big list in JavaScript we need tail call optimization. And luckily ES6 has it.

it was never on by default in v8 and it was completely removed recently which makes me sad

https://bugs.chromium.org/p/v8/issues/detail?id=4698#c69

Re:60 FPS Animations with CSS3 on Tuesday July 11, 2017 @07:47AM (#14743319)
`transition: none` breaks pages relying on the "transitionend" js event (edit: and i guess the other transition-related events i forgot about), i noticed logging into google wouldn't work with it (it wouldn't hide some gray overlay)

here's what i use instead:

  /* forgot if this was needed but i think using !important here broke something */
  transition-property: none;
  
  /* maybe not needed */
  transition-delay: 0!important;
  
  /* non-zero to support "transitionend" event */
  transition-duration: 0.0000001s!important;
  
  /* possible tiny optimization */
  transition-timing-function: linear!important;
i don't know if `animation` has events associated with it but i haven't came across any sites breaking without them

Older »