Here is simple code snippet to add authorization¬†header in an ajax¬†call:   $.ajax({ url: your URL, type: ‘GET’, dataType: ‘json’, headers: { ‘Authorization’: ‘Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJEdTFPeTBJaXh0Sy1fLU8za1FIR2pTekllRC11c1czVEc5MkVWZVJhLW5RIn0.eyJqdGkiOiI2YzgwZWUzYi01ZjZmLTRjZDUtYjJiMC1kNjFlZjgxMGIzY2MiLCJleHAiOjE1MTMwMDc3NDIsIm5iZiI6MCwiaWF0IjoxNTEzMDA3NDQyLCJpc3MiOiJodHRwOi8vYXV0aGRldjo4MDgwL2F1dGgvcmVhbG1zL1NESUVQIiwiYXVkIjoic2VjdXJpdHktYWRtaW4tY29uc29sZSIsInN1YiI6ImFjNTViMGZiLWFjZDgtNGQ2ZC1iZDg2LWJkNWZkMjQ5MDg5YiIsInR5cCI6IkJlYXJlciIsImF6cCI6InNlY3VyaXR5LWFkbWluLWNvbnNvbGUiLCJub25jZSI6IjU3ZTE3MTNhLWU3ZWQtNDFlMi04N2YzLThhYWU1YzU5NjkwYyIsImF1dGhfdGltZSI6MTUxMzAwNTg2OSwic2Vzc2lvbl9zdGF0ZSI6IjhlYzZjZDQ2LTE3YzctNDZjOS05N2UwLTQ5MGQ2ZTlhM2E3ZiIsImFjciI6IjAiLCJhbGxvd2VkLW9yaWdpbnMiOltdLCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiU0RJIEFkbWluIiwicHJlZmVycmVkX3VzZXJuYW1lIjoic2RpYWRtaW4iLCJnaXZlbl9uYW1lIjoiU0RJIiwiZmFtaWx5X25hbWUiOiJBZG1pbiIsImVtYWlsIjoic2RpYWRtaW5Ac21hcnRkZXN0aW5hdGlvbnMuY29tIn0.T8cRQTACjcT6xNWrPY7NIu6lwSliSoyR2WOf8CK6fA_lRoFmzwOddX-1oOf6WIGMVgrAROl-TVHW2wu3z9oW2CAYoBNeRSq5Cv6Bqhaf7KOaG8dpD4Ck0mwLAIhG77x4Y8wPAms5h-BzzWrpS8pM3J8Uda8O_t4cvsVuOx0bwGrBUVebmOBJbVlY2N6_iU7GQ6MRjLrDFiuiNPklERHS44V_622l4IfsyKdnWb_u9B5KuqZt9pDluvjfNG6B2xxsXfJjTmuSHWKPkPRXWGSx87fXBFLW1sZH6MNNpndsBLrxOPiN5PPYwxLeCTu1A_UEWgnecUG6uZJJtc9iJq4dLA’ }, contentType: ‘application/json; charset=utf-8’, success: function (result) { // CallBack(result); }, error: function (error) { } });

Read More →

collected from stackoverflow High Level Summary of Canvas vs. SVG Canvas Pixel based (Dynamic .png) Single HTML element.(Inspect element in Developer tool. You can see only canvas tag) Modified through script only Event model/user interaction is granular (x,y) Performance is better with smaller surface, a larger number of objects (>10k), or both SVG Shape based […]

Read More →

Few pointer To update nodejs run below command: sudo apt-get install git && git clone https://github.com/audstanley/NodeJs-Raspberry-Pi-Arm7 && cd NodeJs-Raspberry-Pi-Arm7 && chmod +x Install-Node.sh && sudo ./Install-Node.sh;

Read More →

Below Code display Video Cam feed on your page… navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({ audio: true, video: { width: 1280, height: 720 } }, function(stream) { var video = document.querySelector(‘video’); video.srcObject = stream; video.onloadedmetadata = function(e) { video.play(); }; }, function(err) { console.log(“The following error occurred: ” + err.name); […]

Read More →

Below code can be used to determine different config value based on the environment the code is running in. “`//Environment Specifc Variable //Environment Specifc Variable Center.Config = { Local: { Api: ‘https://localhost:44300/’ }, Dev: { Api: ‘https://dev.center.com/’ }, QA: { Api: ‘https://qa.center.com/’ }, Production: { Api: ‘https://prod.center.com/’ }, getValue: function (key) { var env; switch […]

Read More →

I needed to decrypt ASP.Net membership provider user password. These password are stored in [dbo].[aspnet_Membership] database. I wrote below code to do the decryption for me . using System; using System.Text; using System.Web.Security; namespace RetreivePassword { public class NetFourMembershipProvider : SqlMembershipProvider { public string GetClearTextPassword(string encryptedPwd) { byte[] encodedPassword = Convert.FromBase64String(encryptedPwd); byte[] bytes = this.DecryptPassword(encodedPassword); […]

Read More →