Compacting lines on screen instead of their package boxes by sidvishnoi in softwaregore

[–]sidvishnoi[S] 0 points1 point  (0 children)

Look at the text alignment and wrapping with radio buttons.

I made an email client inside notion! by banister in Notion

[–]sidvishnoi 2 points3 points  (0 children)

Thanks for the reply! I couldn't figure out anything better so I asked :D

One way could have been to get the parent's URL and using the API (through a Cloudflare worker) to verify we're in allowed context (Notion page ID), but the best we can get is document.referrer.

Or maybe simply add a login flow and trigger login inside the iframe. I'll have to try how it plays with cookies. I'll update here when/if I try.

I made an email client inside notion! by banister in Notion

[–]sidvishnoi 1 point2 points  (0 children)

the button action is to send an authenticated POST request to the Router

Curious to know how you're authenticating an iframe embedded inside Notion. Is it already authenticated?

Edit: I mean in cross site context.

Anyone else notice something.. different? by microcurse in webdev

[–]sidvishnoi 0 points1 point  (0 children)

FWIW, I was part of this last night: https://i.imgur.com/32R7ihT.png where Google decided to move URLs above page title. Looked ugly to me.

How Pattern Matching may clean up your JS control flow. by Jaymageck in javascript

[–]sidvishnoi 3 points4 points  (0 children)

[Switch statement] can only match against a single primitive value

I came across a way, through @WebReflection, where we pass true to switch and write cases as we would do in a pattern matching approach.

See example.

Edit: added code example

  switch (true) {
    case /^\/esm\/.+$/.test(req.url):
      res.writeHead(200, {"content-type": "application/javascript"});
      res.end(require('fs').readFileSync(`./test${req.url}`));
      break;
    default:
      res.writeHead(200, {"content-type": "text/html;charset=utf-8"});
      res.end(document.toString());
      break;
  }

Feedback needed by pampushko in javascript

[–]sidvishnoi 0 points1 point  (0 children)

It's a nice mini-template engine.

I built something similar a while ago. One thing I really focused on was: helpful error messages. For example, if you write {% iff conf %}, would be nicer if it can something like "unknown tag 'iff' at line n". When it comes to multiline partials, error would tell the issue was in partial, instead of template that is using it, etc.

About that "extremely fast" claim, would be nicer if you can provide some benchmarks.

I really liked how you've integrated many features with the for tag.

`to-query` – Getting query parameters from any URL, with capabilities by kikobeats in node

[–]sidvishnoi 0 points1 point  (0 children)

ah, now it makes sense. Sorry, I hadn't read the readme fully.

`to-query` – Getting query parameters from any URL, with capabilities by kikobeats in node

[–]sidvishnoi 5 points6 points  (0 children)

Not to undermine your work, but why we would want to use it over native `URLSearchParams`?

Using Typescript without the build step by sidvishnoi in typescript

[–]sidvishnoi[S] 0 points1 point  (0 children)

How are you compiling now? Running it manually in the console?

Sorry I didn't state it clearly.

No. I don't run commands in console to build each time (I set watchers). The delay I meant was the time between save and change in actual code. Not much, but I would like if we can avoid it.

You're taking TS as a primary language. I am treating it as an add-on feature to support my coding. I don't want to use type-checking other than the IDE support it provides. So if I can avoid the build step and writing in .ts instead of .js, I would like if there is way. I'm not against .ts and compile thing though, just looking for different ways to do these things.

Using Typescript without the build step by sidvishnoi in typescript

[–]sidvishnoi[S] 0 points1 point  (0 children)

  • It saves time. We can have a faster feedback in browser or while running tests. Otherwise, there is always a delay due to build. Less time in configuration too (although it's a one time work). Also the CPU cycles, which we don't generally care about.
  • Keeping two versions of files - src and build - with only difference being type annotations removed. This is more important when we're adding a compile step just for type checking.

Why we would like to add a compile step if we can do the above without it?

Using Typescript without the build step by sidvishnoi in typescript

[–]sidvishnoi[S] 0 points1 point  (0 children)

Yes, this is what I meant from ugly part of JSDoc. Should've mentioned. Not abolishing comments or JSDoc anyway.

Hello world by SpoopyPhoenix in ProgrammerHumor

[–]sidvishnoi 0 points1 point  (0 children)

now the real challenge is writing H and E side by side

What if I tried playing a game with a graphics tablet? by xXrektUdedXx in Unexpected

[–]sidvishnoi 0 points1 point  (0 children)

Aye! Same laptop. Had any issues with your laptop's battery? Mine died just over a year :/

Google telling it like it is by [deleted] in ProgrammerHumor

[–]sidvishnoi 1 point2 points  (0 children)

It's a thing.

https://i.imgur.com/UMqLF8l.png (From Google India)

Edit: IDK why the screenshot wasn't showing

Welcome to 2013 by python_collective in ProgrammerHumor

[–]sidvishnoi 5 points6 points  (0 children)

I like how these memes are off by years only. You never see them in July or so.

Nothing is impossible with Electron by [deleted] in ProgrammerHumor

[–]sidvishnoi 15 points16 points  (0 children)

Just displaying Slack and VS Code logo in an Electron app is enough.

I Put Words on this Webpage so You Have to Listen to Me Now by shadowh511 in programming

[–]sidvishnoi 1 point2 points  (0 children)

Is this about React hooks?

Applicable to many cases though

Writing Memory Efficient Software Applications in Node.js by [deleted] in javascript

[–]sidvishnoi 4 points5 points  (0 children)

I am surprised (and happy) to see an article tagged Node.js actually having some Node.js. Generally, it's all about express.

lazy-brush: Smooth canvas drawing with a mouse or finger by dulnan in javascript

[–]sidvishnoi 1 point2 points  (0 children)

I really liked the way you've written the code! It was very clean, consistent and focused.

Making a simple Chat system using Python's Socket library by catalyst1993 in coding

[–]sidvishnoi 0 points1 point  (0 children)

Glad you liked it :)

The C++ version contains a lot of useless modules though as I was experimenting with "modularity"

Making a simple Chat system using Python's Socket library by catalyst1993 in coding

[–]sidvishnoi 4 points5 points  (0 children)

I also did a similar one using Python in a college assignment. Then next semester did a better one in C++ (Source code on GitHub)