This is more of a quick tip on a Material UI integration than a detailed article. We’ll see how to open the LeftNav component on clicking the AppBar’s left icon (hamburger menu icon). Unfortunately the documentation as of now doesn’t show the ReactJS code for this. Obviously it’s not too hard to figure it out either if you go through the website’s source itself on Github.
Category: Web Development
JavaScript document.execCommand() Web Method
The JS document.execCommand() method is quite interesting. It can be used to execute certain commands to play with an editable region that is achieved either via the contenteditable attribute or when the HTML document (of the main window or some iframe window) has been switched to designMode using this code:
[js]
document.designMode = ‘on’; // or ‘off’
// or for an iframe
iframeNode.contentDocument.designMode = ‘on’; // or ‘off’)
[/js]
Infact try the first snippet right in dev tools and see what happens 🙂
Continue reading “JavaScript document.execCommand() Web Method”
Quick Walkthrough of RSpec Mocks (Introduction) in Code
Before we go through a lot of code samples, make sure you understand the different testing terms like mocks, stubs and test doubles. That’ll help you understand this article much better as I use a lot of those terminologies while going through different code samples.
A test double is a generic term (for stubs and mocks) that represents a real object (but sort of fake) to which messages can be passed (method calls) and fake return values can be specified. It’s used in unit testing to test a particular system or object in isolation. In this article we’ll go through test doubles (mocks) in RSpec. Let’s see how to create a test double representing the object being faked.
Continue reading “Quick Walkthrough of RSpec Mocks (Introduction) in Code”
Stubbing/Mocking Rails.env with Rspec
This is a quick tip where I’ll show you how to stub (sometimes people also refer to it as mock, but I think stub is more technically correct in this case) Rails.env while writing unit tests for your application.
Fixing Laravel Basic Auth Failure
Today, as I deployed my Laravel application, I received an email from my client mentioning that the basic authentication wasn’t working on the production server. I tested promptly and indeed it wasn’t. This was really strange for me as locally all was well. I got stuck at the problem for quite sometime. Searching on Google made me realize that a lot of people have been facing the same conundrum. But finally as usual, I found out the solution not too late.
Change Active State of Links in Sticky Navigation on Scroll
Based on the design decisions made by you on your website (or webapp), you might probably end up having a sticky navigation, one that keeps on showing up in the view port as you scroll up or down. In such a situation, it’s a common desire to have the links in the navigation bar be scrollbar-aware and change their active state as the user scrolls through the page. Let’s see how to do this.
Continue reading “Change Active State of Links in Sticky Navigation on Scroll”
Send Newsletters or Email Marketing Campaigns via Amazon SES with Sendy (PHP app) for Cheap (a Review)
Email newsletters is one of the most effective way to execute your marketing campaigns by reaching out directly to your subscribers who are basically your customers, readers, fans/followers or prospects. But the issue that many of us face is that, as the subscriber base grows or we want to send emails more frequently, the entire process can get a bit pricey when using services like Mailchimp, Campaign Monitor, Aweber, Signal, Constant Contact, GetResponse, LoopFuse, Sales-Push, Mad Mimi, Campaigner, Vertical Response, Benchmark Email, iContact, JangoMail, Boomerang and Ezine Director – unless our requirements can be fulfilled by their free plans.