markdown guide
 
 

Just kidding...

I had once to deal with cross domains cookies sharing.

The idea was signing in multiple subdomain names at the same time (without asking the user to click signin button everytime).

I felt so depressed for a whole weak; I tried tons of solutions... Nothing worked!

A whole weak till I wrote a middleware to share cookies across multiple subdomains... It worked perfectly 💪

Tho I'm never touching that code, EVER!

 

How does your middleware share cookies across multiple domains?

Here is the middleware:

github.com/coretabs/dorm-portal/bl...

Right before serving any request, it writes the same sessionid with CSRF token across multiple domains (pre-defined in an env var), so that you get logged-in once and for all.

  • We have multiple subdomains for this app, like: DOMAIN.com, admin.DOMAIN.com, api.DOMAIN.com

ah, so it's for multiple subdomains under one domain. But in that case, I think it would have been sufficient to just set the cookie for the main domain (.DOMAIN.com) only. it should be accessible by all subdomains too

Yep subdomains (been edited, thx)... and no, it won't be enough 😁

I don't remember what was the problem I ran into after using the main domain trick (adding a dot).

 

What is "10x engineers"? I heard it a little. Is that kind of trends?

 
 

Hopelessness almost always comes from overwork.

I stayed up for 32 hours working continuously to meet a deadline (never ever doing that again). In the middle of trying to do all this work, as tired as can be, your logical processes are breaking down and your ability to fix the problem starts to slip away.

Luckily that employer both recognized the problem with that happening AND understood the damage it did to the codebase (Many would have blamed me instead of recognizing the real problem).

Within a week we were able to stabilize all of the bugs that were introduced and the very next task was to take a design week to pull out the good, and toss the bad (one of the most important things about writing bad code is to a) Know you're writing it, b) know why, and c) do your best to plan for the refactor). A week after that, we implemented a much more elegant solution than we had time for in the rush to go to market.

In that initial 32 hours it was all I could do to keep from saying "this is hopeless".

Just remember that 9 times out of ten, the answer is to walk away, rest your brain, maybe get some sleep and come back to it with fresh eyes. My team was invaluable. My manager was up, working just as hard on that code as I was, understood every shortcut and decision made during that time AND resisted the urge to try and take over, focusing on working on the things that I didn't have the capacity for at the time and supporting where needed).

If you feel like you're in a hopeless situation, rest and lean on the people around you to help dig out of it!

 

I did. I was 16, participating in Google Code-in. The task was to refactor a CI/CD codebase to fetch the initialization script from the CI server instead of GitHub. My mentor was asleep (TZ difference) and I couldn't figure out the relevant code that I had to edit for the life of me. There's not really a comeback story here where I hit up caffeine, stay up all night and blaze away on the keyboard, I just went through it line by line and googled what I didn't know and then opened a PR. It did need modifications after it was reviewed but felt good :)

I won the contest though :D (got to visit Googleplex and SF!)

 

Yes. After 4 days and seemingly hundreds of attempts at workarounds, I could not get around a serious undocumented bug in iOS's Table Header when the contents were positioned using Auto Layout. I eventually cracked it with help from 2 different obscure stack overflow solutions, but right up until that moment I felt completely at Apple's mercy.

 

I recall being really frustrated by an undocumented iOS Safari bug in the past. Seems like Apple's internal bug trackers and forum posts on these subjects tend not to bubble up to search engines very cleanly in my experience.

 
 

At 21 years old, I was allowed to design a digital billboard system. We had identified a vendor who would provide the sign modules, but I was responsible for the design of all control and scheduling software and procuring any additional hardware we needed. It was the coolest thing I have ever worked on.

The day before we're supposed to ship the first batch of signs, I can't get the display driver to work. It was looking like I was going to have to rewrite my code from start and dig into some Win32 nightmare methods to copy video memory. We can't really delay; we have a freight company scheduled to come by at noon and they are expecting six signs on the manifest. Failure was not an option!

I knew I had worked with one of the libraries that played a major part in the vendor's display system before and had a feeling it was missing options. Sure enough, I found some configuration info in a random blog post, and when I copied it over to the sign's controller, everything started working!

I had spent my 21st birthday up til 4AM getting these signs to work, and the glow of the room when the first ads started rolling across seemed so vibrant between the sleep dep/ecstasy of success/recognition I can go sleep now. Looking back, there's no way I would have rather spent my 21st birthday.

 

Yes, it still happens on occasion. Especially when I am not in control of the dependency or surrounding issues of the problem.

It happened far more when I was learning at the coding Bootcamp. Even surrounded by hundreds of other learners going through the same struggle right next to you and a huge open space with tons of mentors, teachers and teacher assistants... You still at times would feel helpless, all the help you could ask for literally physically there for you and you still would feel alone and lost, sometimes convinced you can never do it. Long story short tenacity and overcoming self-doubt with self-motivation (wherever you can get it from) was key to pressing forward. No matter how bad things got, no matter how hard, no matter the imposter syndrome... You Push Through! Let those support systems help you, let those friends and family tell you, you can do it regardless of how tired of hearing you think you are, let those mentors and teachers walk you through thinking models and processes, step by baby step.

Let's be here for each other, in our toughest moments, even if it's a whiteboarding practice problem or an enterprise level production defect.

 

Sure, I once spent two weeks straight (10 hours a day all day) tracking down a bug in my engine that caused everything to render far too yellow. I essentially tore my entire engine apart and still couldn’t figure it out. It ended up being a single directional vector I was passing to my shader and it expected the normalized value while I was giving it a unnormalized value

 

Yes. Was making nlp pipeline and was working with spaCy right when it came out. Stackoverflow didnt have anything on what I was facing, nobody answered my question I asked. I looked at some of their Github issues and was lost. Everyone said it was over their head when I asked for help from others. It totally wasn't over their heads but think it looked scary or something. I ended up going back to NLTK bc of time crunch on project and took a class for learning spacy more. Class I took was too basic. :-/ But -! Got the project done!

 

Yup. I have a few stories of trying to get password saving to work on all browsers, or trying to find memory leaks in react ssr apps, but it's more often that I feel helpless cause my motivation to code fails. Finding the will to work on something I don't find interesting has been the biggest boon on my career, and it still makes me feel helpless daily. :Shrug:

 

Yes, firebase with express has been causing an issue that shouldn't be there because that's literally the first that I added that should've eliminated that error and what's worst is all the tutorials have outdated code even the ones posted few months ago. Firebase docs is so huge since it has support for multiple languages and stack overflow solutions for the error are for front end only. it's frustrating but I'll try to figure it out with fresh mind later.

 

Quite often. But I've built up quite a catalogue of evidence to say I'll eventually crack the problem, or be able to explain it in such a way that a workaround becomes feasible.

Usually by stepping away from the keyboard, taking a break and inviting someone else's perspective.

 

it was in my initial days. I was working on the backend of an exam portal and the client wanted to add mathematical expression in the question. I was using Ckeditor. it took me a good amount of time to figure that out.

quite an exp. that was.

 

Well, a few days ago I was asked to solve the "Minimum Transaction Problem" in a test. Things didn't go well like... at all.

I was absolutely lost. I have some knowledge in algorithms, data structures and graph theory, but I never had to solve something like that. Of course, I didn't pass the test.

For me the biggest problem was the lack of time to think. I had like 2 to 3 hs to solve something that I've never faced before and I had to rush a solution. It was a total failure.

I think that when we're facing a problem and we're hopeless the best thing to do is to take a break, like a real brake, and do something else. Take a walk, play some games, watch a movie. Come back a few hours later - or just take the day off - and then face the problem starting from scratch with a new mindset.

 

Yes, when I first started Java I almost gave up...
I made the mistake of thinking "System.out.println();" was
" System.out.printin(); " cause the code playground I was using made 'i' and 'l' look the same...

 

When I'm in a work environment, I always try to relax and build my stuff as good as I can. If I can't do something, because I lack either skill or time, I talk to the manager and try to find a solution. I take a pretty hard stance against working overtime or an unhealthy environment, so I rarely get into those situations.
At pet projects it's even more relaxed because I can take my time to learn everything to complete it.
However, when I get stuck doing a coding test in a job interview, I really do feel helpless, because there's a time limit and there are no colleages to turn to for help.

 
 
 
 

Yeah, I felt completely helpless when I was first started to wrap my head around AWS.

That time was a nightmare.

 

There was the time I spent a week trying to get going with an R project and failing because the documentation lied about how to open a data set and I thought I just couldn't copy/paste right...

 

yes. a lot of times, especially when I was working on not 100% dev topics like GeoJSON display in a browser. I had to learn geography again :)

 

I can handle coding problems; it's the deep-rooted organizational/procedural issues that make me feel helpless. Any problems I've faced in code can usually be traced to how the organization operates.

Classic DEV Post from Jul 30 '18

GIT Commands: Desktop App built with ElectronJS and ReactJS to be cross-platform.

GIT Commands is a desktop app built with ElectronJS and ReactJS to be cross-platform

Ben Halpern profile image
A Canadian software developer who thinks he’s funny.

dev.to now has dark theme. 🌝

Go to the "misc" section of your settings and select night theme

P.S. You can also change font to sans serif, which a lot of folks prefer. 💖

P.P.S. It's also the best place to talk code amongst thoughtful developers, and it's totally open source