Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "interceptor"
-
So apparently somone put Snapchat's iOS source code on github. I love the capitals in this DMCA notice like SHIT! SHIT! SHIT! take it down already.
https://github.com/github/dmca/...16 -
Friend: Is blockchain a programming language?
Me: No it's a java framework
Friend: Ah, thanks for clarification.6 -
Gave a talk in front of 150 people today. For first 5 seconds my brain was like wtf, fml
Managed to not shit myself for next 30 mins
Fuck! Should stay introvert7 -
10-1 AM - 4 of us got drunk.
2-4 AM - 2 hours straight coding, solving big-ass problems
10 AM - Fucking hangover and python code in a java project!4 -
Dumbass client renamed jpeg extension when asked for a png file. Ofcourse Android build system is little more sophisticated than that.
What a shit day!2 -
What do you look for in a programming language
People: features, syntax, runtime blah blah
Me: Active meme base -
Friend learning typescript: JavaScript is easy, you do exactly opposite of what you did in java. Typescript is a half baked mess.
-
Designer: We need gradients and curved UI elements to make our product look modern.
- Codes over a month to support that.
Client: yeah gradients don't go with our branding and could you remove those curves!
FML4 -
- Bad at pretty much everything else
- Bad at pretty much everything else
- Bad at pretty much everything else -
LinkedIn recruiter message
Hi I have an exciting opportunity for you which i will not share on messages but why don't you give me your phone number, email, home address, favorite color so that i can email the same shit to you instead of sending it in the LinkedIn messages and also give me your phone number.2 -
!dev
It's ridiculous that it's 2018 and i can't connect my $120 bluetooth headphones to my playstation 4!
Come on Sony! -
Calling in all Vue devs here! (Possibly any SPA dev actually)
We're building these fancy live-edit fields for our app. It syncs with the database with every keypress (with a debounce, ofc). Now, we're having a global Vuex module to keep track of the applications sync state. Using this module, we can prevent the user from leaving the page if there is data that hasn't been synced. Though, I think I'm doing something wrong here, and not strictly adhering to the "single source of truth"-principle.
When a user has finished typing, a request is made through Axios. When the response arrives, the field issuing the request updates it's display accoring to the response. However, there is also an Axios interceptor which updates the global state to reflect the latest response. Is this wrong? Should the fields themselves emit the mutation to the store? Or is it okay to use an interceptor since they're running down the same call stack?
I think my biggest worry here is that the interceptor and the field will interpret the response differently...
Help is appreciated :D (and thanks for taking the time)18 -
Oooh I have quite a few,
My favourite: accidently left a log. Debug("bollocks") in a try catch this made it through testing and does (still) occasionally go into production log files.
Worst: wrote an interceptor for jboss with the intent of checking cache for some lookup data. I picked the wrong one of two similarly named methods and instead queried the database, I effectively wrote a denial of service utility into our app -
Kids: I'll tell mom, she'll scold you.
Adults: Looping in my team lead in mail chain
Source: Twitter1 -
I once wrote an http interceptor for which was supposed to check the internal cache for user data and only do some work with it if they were (we manually controlled what and who was in cache). There were two methods on the service cGetUser and dGetUser I of course called d which it turned out loaded the user profile from the database which would be fine if it weren't done in an interceptor .. on a web service... With a little over 25000 requests per minute.. on each node..
Tldr. I accidentally wrote a database ddos tool into our app...2 -
I once had to write an http interceptor for a distributed api. The interceptor needed to use the request context and the user profile to work out if a particular type of content had previously been accessed. Anyway there were two methods to get the user profile getUserC and getUserD, turns out C stood for cache D stood for database. Of course I called getUserD I effectively wrote a database distributed denial of service tool into our app 😬 we got a call from our customer complaining that their exadata servers where grinding to a complete halt2
-
I thought debugging node.js would be me throwing a bunch of commands at terminal but thankfully saner minds created vs code debugger.
Also vs code documentation should be a lesson to everyone on how to document stuff. -
Found a bug
- Calling function sent wrong parameter.
- Calling function itself was shit. Changed it.
- Few hours later, revamped whole class, updated all references and pushed to production next day.
Till date that class has not changed and still works flawlessly!
And probably first time I used queues in java. Algorithms FTW -
Getting the angular interceptor working the way I want has proven to be a pain for me. I try to update an auth token, which returns a promise that has to be transformed to an observable again. based on that, redirect to a login page, in case of 401. But nothing works! Either infinite page reload because of the login() promise function of the auth provider or no reaction at all after a router redirect. 😤4
-
Somehow mocking xhr requests (?) for Axios is really hard to make it work. I use React Cosmos as I'm re-doing the frontend of this already running in production and works great, but when my component communicates with the backend it breaks and I'm unable to test the full behavior.
Then, it occurred to me that trying to mock Axios may not be the best. So I came with this scheme where I would have a configuration variable with a default value and change that when I need to work with React Cosmos, which in turn changes the behavior of `/auth` to return a valid JWT in response to a GET, put an Axios interceptor in my outermost Cosmos decorator and BAM! suddenly was able to develop and test my React components closer to how they would work in production.
It surprises me how simple this endeavor was, and because everything runs orchestrated by docker compose things run smoother.
(this is not an excuse to not to learn how to deal with the mocking issues of Axios, after all I wont have a working backend every time I work in some frontend application)5 -
PLEASE how do i build an interceptor in angular to block the user from accessing any part of the website until they get approved? Already built an interceptor for auth jwt n shit.4