Skip to main content

Posts

Showing posts with the label solutions

How to keep a user logged in?

Hi everyone, Let's prepare some Cookies this time... I've been searching for a secure method for keeping a user logged in. You knew that's easy by keeping sessions in server side. Well, I'm not referring that scenario. You must have seen many " remember me "s just like the one in the figure. This time I'm gonna share some insights of remembering the user after he leaves the current session. But, hey! Do you like Cookies ? Well, I know that's an ambiguous question. Anyway we're going to prepare some Cookies and coffee. Nice combination, right? Actually coffee helps me to create Cookies, mentally. One insane thing here is no one else will be able to taste your Cookies, but you. And that's a necessary thing for adding security to your system. Let's start overflowing from the Stack I noticed this discussion on Stackoverflow, which essentially gives you some kind of... i don know... pleasure!? But there is a possib...

Sorting table with angular

Below is a demo of sorting a table with Angular. ----------- Name Age Salary DEC table will be ordered by {{orderBy}} name age gender email salary {{employee.name}} {{employee.age}} {{employee.gender}} {{employee.email}} {{employee.salary}} ----- codes -----

Missed you Angular

In a phase when I was developing Formia (our acadamic mini project), I needed to add a dynamic heading. hmm.., that means: I have an <input type="text" name="title"> and a <p>...</p> tag. I wanted to display the content of text box on <p> as I type on text box. At that point, I was unaware of AngularJS . I implemented that in pure JS. wired... For the record, this feature could be implemented easily by Angular, as follows: When you type on the box below, the content will dynamically display next to it. {{message}} (for best results use Chrome / Firefox) Well, how's this happening? Add the Angular CDN script to top of the HTML. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> Add this 4 line to have that magic. <div ng-app=""> <input type="text" ng-model="message"> ...

Talky Messenger Documentation & Setup

( Github ) Just created a chat app that runs in Node and Socket. the attempt was worthy. Talky is a messenger app built with Node, Express, Socket, Angular & Bootstrap. It's like a server-client structure. (But obviously not like the one we done at OS lab using shared memory). It has a broadcasting structure. Talky does not keep a log on chat. i.e., It doesn't have a memory or database. When we close the browser window, chat history is lost. There I also added a basic console, protected by a password, to send real-time notifications to active clients. The name 'Talky' was suggested by a friend of mine. (hey, thank you for that. The fact is that I am not really good at naming...😝) What if sometimes your college blocks WhatsApp? Try Talky. ( There is also a website on internet in the name of 'Talky' which has no connection with this one. ) Download Talky Messenger To use Talky, all you need is 3 things: Node server Source code...

How to optimize web pages across the browser.

Google Chrome is my favourite browser. It has given immense developer features. When I opened my first web page on Firefox for the first time, it disappointed me. I found some length, padding, margin, font etc. mismatches. The pages which correctly rendered in Chrome were not that much accurate on any other browser. It was because of the default values stored in them. Different browsers may have different default values for them. I used Google Chrome to develop my website - thus chose values for margin, padding etc. in a way that it balances the default values. Those chosen values cannot balance the default values stored in other browsers. Mainly there are 2 solutions. You should use one of these solutions while developing a website. 1. Use a css reset. The simplest method is to use a CSS reset. here is one.. --- 2. Use a framework. Using frameworks are one of the best choices. They offer fast development and responsiveness. Most popular frameworks are Boots...

Market Segmentation

How to pass variables to res.render() in Node.js

I was trying to figure out how to render a view inside a view, as I was stuck with this issue. Horrible Effects of Misplaced Extensions ;) I was using Node.js platform with ejs template engine. My index.ejs file has an included header.ejs file. Everything works well except that I can't pass values to the variable status in header.ejs. Here is my abstract code... index.ejs header.ejs app.js The most funniest solution ever! The solution is as easy as this. Just remove .ejs extension from the include command. I spent at least an entire night to figure it out.