• 7 Posts
  • 73 Comments
Joined 2 years ago
cake
Cake day: July 22nd, 2023

help-circle

  • First, imagine a number in JavaScript. (Bit of a nail biter here, huh?)

    let i = 5
    

    Then, we will construct an incrementor. This is really simple: here is the method.

    1. Make a bracket-string-centric version of eval().
    []["filter"]["constructor"]("return i+1")()
    
    1. Reconstruct stringy eval() by using +[] as 0, +!+[] as 1, and implicit conversions as ways to create strings. For example, ‘false’ is (![]+[]), so ‘f’ is (![]+[])[+[]].
    [][
      (![] + [])[+[]] + // f
      ([![]] + [][[]])[+!+[] + [+[]]] + // i
      (![] + [])[!+[] + !+[]] + // l
      (!![] + [])[+[]] + // t
      (!![] + [])[!+[] + !+[] + !+[]] + // e
      (!![] + [])[+!+[]] // r
    ][
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      ([][[]]+[])[+!+[]]+ // n
      (![]+[])[!+[]+!+[]+!+[]]+ // s
      (!![]+[])[+[]]+ // t
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+[]]+ // u
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[])[+[]]+ // t
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      (!![]+[])[+!+[]] // r
    ]("return i+1")()
    
    1. Draw the rest of the fucking owl. Final code:
    let i = 5; // haha yay
    
    [][
      (![] + [])[+[]] + // f
      ([![]] + [][[]])[+!+[] + [+[]]] + // i
      (![] + [])[!+[] + !+[]] + // l
      (!![] + [])[+[]] + // t
      (!![] + [])[!+[] + !+[] + !+[]] + // e
      (!![] + [])[+!+[]] // r
    ][
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      ([][[]]+[])[+!+[]]+ // n
      (![]+[])[!+[]+!+[]+!+[]]+ // s
      (!![]+[])[+[]]+ // t
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+[]]+ // u
      ([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+ // c
      (!![]+[])[+[]]+ // t
      (!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+ // o
      (!![]+[])[+!+[]] // r
    ](
      (!![]+[])[+!+[]]+ // r
      (!![]+[])[!+[]+!+[]+!+[]]+ // e
      (!![]+[])[+[]]+ // t
      ([][[]]+[])[+[]]+ // u
      (!![]+[])[+!+[]]+ // r
      ([][[]]+[])[+!+[]]+ // n
      (+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+ // ' '
      ([![]]+[][[]])[+!+[]+[+[]]]+ // i
      (+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]])+[])[!+[]+!+[]]+ // +
      +!+[] // 1
    )()
    // no virus i swear. execute arbitrary code in your browser console.
    

    Anyway, that’s just everyday JS work. It’s like step 5 after resizing the button, but a bit before centering the div.

    based on this. some translation methods done differently.







  • fool@programming.devtoSelfhosted@lemmy.worldhow much power does your system need?
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    3
    ·
    edit-2
    1 month ago

    I forgive 'em cuz watt hours are a disgusting unit in general

    idea what unit
    speed change in position over time meters per second m/s
    acceleration change in speed over time meters per second, per second m/s/s=m/s²
    force acceleration applied to each of unit of mass kg * m/s²
    work acceleration applied along a distance, which transfers energy kg * m/s² * m = kg * m²/s²
    power work over time kg * m² / s³
    energy expenditure power level during units of time (kg * m² / s³) * s = kg * m²/s²

    Work over time, × time, is just work! kWh are just joules (J) with extra steps! Screw kWh, I will die on this hill!!! Raaah





  • CRYPT-- oh, you mean how the nice tutorial peeps have affected us.

    Vimjoyer has increased the adoption rate for flakes on NixOS. And also NixOS use in general.

    Mental Outlaw has probably contributed to new Gentoo users, quoth the meme, but Gentoo is still a dying breed compared to its heyday in the early naughts.

    Fireship has made people – particularly CS students I believe – more comfortable with trying out new programming languages. (The “I’ll check out the Fireship video first” approach. But then again, ChatGPT has arguably had the same effect across undergraduates… that’s a digression)

    Asahi Lina’s longform Rust dev work, while less of a network effect, has had its own substantial effects within the Asahi Linux “Linux on the M-series” sphere. I believe she also helped port a kind of anime mocap engine onto Linux, which could over the longterm boost the anime-nerd Linux-nerd center Venn diagram. But that’s speculation.

    edit:

    In a broader perspective, with the combination of SteamOS and large YouTubers trying out Linux, Linux desktop adoption will probably increase more than it has now. I doubt it will pass 10% though with Linux’s reputation (tech nerds, compile all day, games don’t run, command line – even though these are improving, it’s hard to kick)








  • Oh my God I LOVE FONTS

    Spartan is a bit wide for me (see that w?) but Lato with a good colorscheme is always sexy

    Another thing: if you’re familiar with fonts you can have a weird pseudo-Sherlock funtime guessing how something was made.

    points This book is using Georgia instead of Times New Roman. See how the 9 is low? But the page numbers are Times New Roman because the 9 isn’t low. Was paging in the author’s control?

    and

    font with the light blue shading thing. This club recruitment poster was made in Microsoft Word.

    About serif disdain… what about LaTeX’s serif? :}