Swagger UI is a visual interface for viewing and interacting with RESTful APIs described using the OpenAPI Specification. To open a local JSON file in Swagger UI, we need to use a local HTTP server to serve the file and make it accessible to the Swagger UI interface. Any HTTP Server should work. In this…
TIPS & TRICKS
The URLSearchParams interface defines utility methods to work with the query string of a URL.
const url = 'http://example.com?orderNumber=123456&pageSize=20';
const urlSearchParams = new URLSearchParams(url);
console.log(urlSearchParams.get('orderNumber')); //result: null
console.log(urlSearchParams.get('pageSize')); //result: 20
As shown in the above code snippet, it won't work as expected if you directly use the URL string in the URLSearchParams constructor. So the result of the first…
Whenever I migrate my WordPress site, I manually export and import the data, images, plugins, settings, etc. This time I have decided to use the All-in-One WP Migration plugin. After exporting the data, images, plugins, settings using the All-in-One WP Migration plugin from the current site, I went to my new WordPress site and try…
I had a need to regular convert excel to csv file for processing instead of every time opening them in excel and save as CSV, below Python script using Pandas library converts all excel files in the given directory to CSV files.
import pandas as pd
import os
path = '/Users/shravan/Documents/files/'
csv_dir_path = os.path.join(path, 'csvs')
files = os.listdir(path)…
Follow the below steps to delete all the lines in a file (emptying file) using VI / VIM editor. Open the file vi <file-name> Press gg, this will move the cursor to the first line of the file. Now press dG, this deletes all the lines. Finally, type :wq to save the changes and exit from the…
I recently started running my gulp tasks directly from Visual Studio Code instead of command line, I am going to explain how to do that. Step1: Make sure your project has Gulpfile.js or gulpfile.babel.js Step2: In Visual Studio Code once you open the project, press CMD + SHIFT + P (CTRL + SHIFT + P in Windows),…
There are so many blog post explains the complex process of setting a custom icon for a folder in OS X. Neither I don’t want to run complex scripts nor go through some complex process. I found a simplest solution on the Github by Gregory Zuckerman. I cloned his Github icons repository to my github account. You…
In one my recent application (HTML 5 static mobile app) I have a requirement to persist couple of JSON objects across the application. Earlier, this was done with cookies. With HTML5, web pages can store data locally within the user’s browser using Web Storage. Web Storage is more secure and faster compare to cookies. The…
Html.RenderAction() and Html.Action() methods are available in ChildActionExtensions (System.Web.Mvc.Html) class in ASP.NET MVC. Generally both methods are used for calling action methods or child action methods and rendering the result of action method in view. @Html.Action() – Invokes the specified child action method and returns the result as an HTML string. @{ Html.RenderAction(); } –…
First version of razor is shipped with ASP.NET MVC 3. ASP.NET MVC 4 come with Razor V2.0. Razor V2.0 includes some tiny & happy features. URL Resolution Enhancements: We use the relative URL for any resources (images, scripts, css) in code , for example : <script src=”~/Scripts/jquery-1.8.2.js”></script> But in runtime we should resolve the full…