Refactoring JQuery to React
JQuery is quickly becoming a thing of the past, and in it’s place stands React. I mean, even John Resig, author of JQuery, uses React now. So how can you refactor your website to use React instead of JQuery?
JQuery is quickly becoming a thing of the past, and in it’s place stands React. I mean, even John Resig, author of JQuery, uses React now. So how can you refactor your website to use React instead of JQuery?
.When I first started out using Redux, I learned very quickly how to use (read: abuse) Redux actions. Actions and middleware used to be simple: if it’s synchronous, put it in an action, but if it’s asynchronous then you should use middleware.
One problem I’ve been struggling with lately is: what is the best way to store tokens when using redux? I could store it in the Redux state, but then it wouldn’t be there after refresh. I could just store it in the browser’s localStorage, but where would I do that?
User Authentication is a simple concept, but when it comes to properly implementing it in Django, things can get complicated. Django offers an abundance of different authentication mechanisms: BasicAuthentication
, TokenAuthentication
, SessionAuthentication
, and various ways to implement custom authentication mechanisms.
I’ve recently come to the realization that I can’t work towards all my goals and achieve the progress that I need. When you’re actively trying to make progress on too many goals, it makes it harder to get to your milestones. You’re spread too thin. When you can’t complete milestones, you quickly lose the drive to work on anything. Before long, you’ll give up. But it doesn’t have to be that way.
Software Development can be hard on its own, but when your own development environment doesn’t work for you it makes it even harder.
I’ve been writing Python for some time now, and when I reflect on some of the older code I’ve written… I sometimes cringe. For example, when I was just starting out, I wrote this Sudoku game in python (available on GitHub here). I thought that this was one of my better pieces of work at the time. It turns out I can’t even clone and run this because I didn’t add a setup.py or requirements.txt file, a mistake I would never make today!
Today I was doing some programming, trying to finish up an old project that was 80% done, but I never finished. The project is an API for sharing beer ingredient data, being the avid homebrewer that I am. I was in the middle of writing some pretty simple authentication logic, when I found a weird bug in my code. The code, featured below, was pretty straightforward, or so I thought.
This post is part of a series of mine on building web applications from the ground up. It covers everything you need to know to completely finish a web application. If you haven’t been following the series, please go back and read part 1.
This post is part of a series of mine on building web applications from the ground up. It covers everything you need to know to completely finish a web application. If you haven’t been following the series, please go back and read part 1.