Sponsored Links

December 6, 2020

How to be safe from Phishing

One of the most common ways of hacking and retrieving user information is Phishing. It is a cybercrime in which the scammers target users through emails, text messages, fake social media posts using some brand names posing as a legitimate institute to lure the users with lucrative offers to get the personal information which may result in identity theft or financial loss.

Today almost all people in the world have access to the internet. People will have emails, social media accounts, online banking account, etc which contain their personal information, banking details, etc. The only way to access them is a password. So your password must be strong enough to protect your digital information. But only this is not enough. Scammers can use different ways to get your password and use it for their benefit. So one golden rule is never ever to give your password to anyone. Use your password only on the official website where it is used. So let's see how can scammers use phishing to get your information.


September 6, 2020

OnePlus Nord Specifications and Price in Nepal

One plus Nord is released in the market which is supposed to be medium-range mobile with awesome features of high-end mobile phones. It is available in 3 memory variants with different prices. Check the specifications of this phone below.

OnePlus Nord


Released Date: 2020, August 04
Body: 184g, 8.2mm thickness, 6.44"
Operating System: Android 10; OxygenOS 10.5.4
Storage: 64GB/128GB/256GB storage, no card slot
Memory: 6/8/12 GB RAM
Battery: 4115 mAh, non-removable
Network: GSM / CDMA / HSPA / LTE / 5G

May 4, 2020

OnePlus 8 Pro Specification

Released Date: 2020, April 21
Body: 199g, 8.5mm thickness, 6.78"
OS: Android 10; OxygenOS 10.0
Storage: 128GB/256GB storage, no card slot
Memory: 8/12 GB RAM
Battery: 4510 mAh, non-removable
Network: GSM / CDMA / HSPA / LTE / 5G
SIM: Dual SIM (Nano-SIM, dual stand-by)
OnePlus 8 Pro

DISPLAY:
Glass front (Gorilla Glass), glass back (Gorilla Glass), aluminum frame
Fluid AMOLED capacitive touchscreen, 1B colors
Resolution 3168 x 1440 pixels 513 ppi
Chipset: Qualcomm SM8250 Snapdragon 865 (7 nm+)
CPU: Octa-core (1x2.84 GHz Kryo 585 & 3x2.42 GHz Kryo 585 & 4x1.8 GHz Kryo 585)
GPU: Adreno 650

MAIN CAMERA
48 MP, f/1.8, 25mm (wide), 1/1.43", 1.12µm, omnidirectional PDAF, Laser AF, OIS
8 MP, f/2.4, (telephoto), 1/1.0µm, PDAF, OIS, 3x optical zoom
48 MP, f/2.2, 14mm, 116° (ultrawide), 1/2.0", 0.8µm, PDAF
5 MP, f/2.4, (depth)

Features Dual-LED flash, HDR, panorama
Video 4K at 30/60fps, 1080p at 30/60/240fps, Auto HDR, gyro-EIS, time-lapse

May 3, 2020

OnePlus 8 Specification

Released Date: 2020, April 21
Body: 180g, 8mm thickness, 6.55"
OS: Android 10; OxygenOS 10.0
Storage: 128GB/256GB storage, no card slot
Memory: 8/12 GB RAM
Battery: 4300 mAh, non-removable
Network: GSM / CDMA / HSPA / LTE / 5G
SIM: Dual SIM (Nano-SIM, dual stand-by)
OnePlus 8
DISPLAY:
Glass front (Gorilla Glass), glass back (Gorilla Glass), aluminum frame
Fluid AMOLED capacitive touchscreen, 16M colors
Resolution 1080 x 2400 pixels, 20:9 ratio (~402 ppi density)

Chipset: Qualcomm SM8250 Snapdragon 865 (7 nm+)
CPU: Octa-core (1x2.84 GHz Kryo 585 & 3x2.42 GHz Kryo 585 & 4x1.8 GHz Kryo 585)
GPU: Adreno 650

MAIN CAMERA
48 MP, f/1.8, 25mm (wide), 1/2.0", 0.8µm, PDAF, OIS
16 MP, f/2.2, 14mm, 116° (ultrawide)
2 MP, f/2.4, (macro)
Features Dual-LED flash, HDR, panorama
Video 2160p at 30/60fps, 1080p at 30/60/240fps, Auto HDR, gyro-EIS

April 1, 2019

How to disable right click on web page using jQuery

There are certain ways to disable right click on web page. One of most common ways is using following jQuery code in the web page. Add following code at the end of body inside script tag. Note that it uses jQuery. So import jQuery first.

$(document).bind("contextmenu", function(e) {
     e.preventDefault();
});

November 12, 2018

Hottest Trend in IT 2018

From various research and usage, following seem to be hottest trend in the industry right now.

Front End Development:
ReactJs
Angular

Learn about progressive web apps because it will soon take over android and IOS native mobile apps.
Progressive Web Apps

Learn about big data, machine learning and AI
Tensorflow
Hadoop
Spark

Improve your programming skills on javascript, python, java . 

Awesome Tips for Developers


There are many tips for becoming better developer if you search for. Among many ideas and tips following four points have more striking effects. Please read it and implement right away.
  1. Learn to code by hand on paper and a whiteboard first and then throw it into an IDE for syntax highlighting, this should become second nature to you.
  2. Develop deep knowledge of data structures , their strengths, and weaknesses in comparison to each other. I discovered that implementing data structures and their behaviors from scratch taught me so much more than what i knew from their abstract concepts.
  3. Completely understand Big O notation for both time and space complexities, this will pair perfectly with your algorithm and sorting questions.
  4. Grasp all major sorting algorithms because the difference in time/space complexities have the potential to derail your optimum solution for an algorithm you're trying to solve.

August 19, 2018

Top 30 ways to become better developer

Here are top 30 tips for becoming a better developer. If you follow all these steps then you already are a better developer.
  1. Read other people's code:
    You need to make a habit of reading code written by other developers. You can learn many things from this. Obviously there are BAD CODES out there but you need to have sharp selection for reading quality code. This will help you learn new techniques, languages and quality code from other developers.
  2. Write shorter methods/functions:
    Always try to make your functions as short as possible and to the point. Writing short methods will help to organize, maintain and test the code. And always remember one tasks one method.
  3. Learn New Language:
    Try learning new language whenever possible. No language is perfect and learning new language helps you to know work around and quirks of languages.
  4. Write a test before coding:
    Before starting to code to develop features first write a test for the feature. It will help to develop feature without possible bugs and going out of track.
  5. Single Responsibility Principle:
    Give single responsibility for a class. It is best practice to give single task to each class. Any class with more than one major responsibility should be broken up into smaller classes.
  6. Learn to Debug:
    Debugging is one of the crucial part of developers. Debugging a problem can take nasty amount of time if you are not used to it. There are many debugging tools out there for you. Use them and get used to it. It will pay you off in future.
  7. Write clean code:
    Writing a clean code is something that is achieved by practice. It won't happen over night. You need to write many lines of code, refactor them and improve them time and again. Also you should be consistent while coding like proper spaces, variable naming, formatting etc. Your code should be readable for other programmers and can understand the motive of code once then read them. Try to make your code as simpler as possible.


...to be continued

December 29, 2017

How to Find any Wi-Fi Password on Windows

Sometimes you may forget the wifi password of your network you are connected or it may be difficult to remember password. So here is the simple command line trick to find out the password. Follow these steps if you’re using Windows 7,8 or 10.

  • Open CMD as an administrator.
  • Paste the following code:
  • netsh wlan show profiles
    You will get a list of the networks that are known to your computer.
  • Now paste the following code. Replace "profilename" with the network name.
  • netsh wlan show profile name=profilename key=clear
    Look for the "Content Key". That is your password.

December 14, 2017

Things to Remember If You Are Developing Your Website

If your are starting to develop your website or starting website development then you should consider user experience also. I am giving some tips to get started here. If you do not know anything about typography, but you care about readability, you should try this as a starting point.

  1. A minimum of 18px font size.
  2. Line spacing of 1.6
  3. #333 for color or thereabouts.
  4. Limit your lines to a width of 700px.
These are few tips for starting. I will keep updating it with other useful tips for starting as developer.

5 Tips to Become a Web Developer

If you ever wanted to become a web developer then here are the five tips to get started with.
  1. You can volunteer or intern in different companies. This is the quickest way to get hired or work as a web developer. So find any local companies or any around you and ask for volunteer.
  2. Your goal is to gain experience in the real world as quickly as possible and build your portfolio. So say yes to every websites including unpaid ones.
  3. You need to build your portfolio to make it strong. So where do you put your work? Well, this can be your own web site and I recommend this if you want to look professional. You can host it on GitHub.com and GitHub.io all for FREE and you can buy your own domain also if you like.
  4. Find a mentor and join local or online coding groups.
  5. There are plenty of open source projects today. You can contribute little by little in those projects to make familiar with the web development world

December 13, 2017

Rare Euro Coins

2 Euros coin dedicated to Grace Kelly was put into circulation in 2007, and it costs between 600 to 1,000 euros. Just 20,000 of them were made. 1 Italian cent was released in Italy 15 years ago, and costs around 6,000 euros. Why? The coins, issued in 2002 have the same design as 2-cent coins.

December 9, 2017

How to clean your Windows Temp folder

The temp folder contains files that are only needed temporally. Unfortunately, these files that are meant to be deleted don't always get deleted after their job is done, resulting in wasted drive space.

To open the temp folder, click Start or go to the Windows 8 Search, type %temp%, and select the folder that appears first. Once the folder is opened, you can manually delete files and folders. But you probably can't delete all of them. Windows won't let you do away with those currently in use. That's fine. You don't want to delete those ones anyway.

In fact, you really don't want to delete any files created since the last time you booted your PC. So if you shut down Windows every night (and I mean shut it down, not sleep or hibernate), and boot clean every morning, you can safely delete any files in Temp not dated today. You can easily do it in an old-fashioned way, DOS-style batch file to automatically clean out the folder every time you boot. Here's the process:

Open Notepad, and type these two lines:

    rd %temp% /s /q
    md %temp%

Save the file as %appdata%\microsoft\windows\start menu\programs\startup\cleantemp.bat. This will create the batch file, cleantemp.bat, inside your Start menu's Startup submenu. Everything in that menu loads automatically when you boot. Windows 8 doesn't have a Start menu. But it still has the folder. And the trick still works.

Enjoy!!!

December 5, 2017

Time Saving Tips for AngularJS Developer

Here are some of the tips while learning and coding on angularjs.

At a high / architecture level:

  1. Do not forget to write your tests. In Javascript, you don't have the compiler to hand hold you and tell you that you did something wrong. And you will want to pull your hair out the next time your app is broken because of a missing letter. And the large your application gets, having the comfort of making large scale changes and refactorings without worrying about broken functionality is amazing. And writing your unit tests is the only way to get there.
  2. Don't put too many things on the scope. The scope is expensive, as it is the one that undergoes dirty checks. Just put exactly what will be displayed on the UI on the scope, and leave the rest as variables in the controller, but not on the scope.
  3. Data is the truth. Let the data drive the app, and not any other way. You should purely focus on getting the data in the right places. The route controlling logic, the watches and the data binding should drive what is visible in the UI.
  4. If you need a UI widget like datepicker, autocomplete then think directive. Wrap all your third party components in directives for easy reuse, as well as to make your app modular. Being able to write <input datepicker> is way better than writing <input id="myinput"> and then in JS, $('#something').datepicker().
  5. Don't do DOM manipulation in your controllers, as well as your services. Try to restrict that work to directives.
  6. If you need to communicate between controllers, there are basically two options. Either create a service which is sigleton and use it to communicate or fire events on the scope, and have the other controller watch. Don't create your own new way outside of these two.
  7. Dependency Injection: Understand it, love it, breathe and live it. That should be the one and only way you ask for and work with services or any dependencies from any of your code.
  8. For directives, try and isolate the scopes so that you can reuse them without worries. Isolating the scope ensures that your directive does not depend on some particular method / variable on a parent scope, and thus can be reused. Pass in whatever you need as arguments to the directive. Use the databinding to ensure you get the updated value instead of the value at that instant.

Basic Linux Commands

Below are some of the commonly used linux commands.
Note: Think twice before using rm -rf / command. :D

Regular Expressions in JavaScript with Examples

Example 1 : To return all the matched strings
var a = "This is regular expression example.";
var regex = /regular/g; // to find string regular
var matches = a.match(regex);


Example 2:  To return all matched numbers
var a = "This is 1 apple, this is 2 apple";
var regex = /\d+/g;
var matches = a.match(regex);

Example 3:  To return number of spaces in the sentence
var a = "How many spaces are there in this sentence?";
var regex = /\s+/g;
var matches = a.match(regex).length;

How to Generate Random Number within the range

This example shows how to generate random number from the range of number given.
function generateRandomNumber(minNum, maxNum) {
        return Math.floor(Math.random() * (maxNum- minNum+ 1)) + minNum;
}
generateRandomNumber(5, 15);

Above code will generate random number between 5 and 15.

Cool jQuery Tricks

Some of cool jQuery functions usage:
1. To add bounce animation to any element:
 $(elem).addClass("animate bounce");

2. To add shake animation to any element:
 $(elem).addClass("animate shake");

3. To disable buttons or any control elements:
$(elem).prop("disabled", true);
You can also use attr() function, but attr() is deprecated. So use prop().

Cool JavaScript Tricks

Today I would like to mention some of the JavaScript tricks that many JavaScript programmers do not know. They are cool to have in our code, but some are not practiced in real world. Here are few of them.
  1. Use of .call() function:
    If you want to iterate over the properties of object.
    var listitems = document.querySelectorAll('li'); 
    [].forEach.call(items, function(item) {
    //your code here
    })
    
    Above code does the same as the code below
    for (i = 0; i < items.length; i++) {
    var item= items[i];
    // your code here
    }
    Reversing a string:
    var js = 'hello javascript';
    var sj = [].reverse.call(hey.split('')).join(''); // "tpircsavaj olleh"
    console.log(sj);
  2. Always use var while declaring variable for the first time.
  3. Use === instead of == .
  4. undefined, null, 0, false, "", NaN are all false values.
  5. Use semicolon (;) for line termination.
  6. Get random item in an array.
    var items = [12, 548 , 'a' , 2 , 5478 , 'foo' , 8852, , 'Doe' , 2145 , 119];
    var random = items[Math.floor(Math.random() * items.length)];
    
  7. Verify that the given argument is number
    function isNumber(n){
        return !isNaN(parseFloat(n)) && isFinite(n);
    }

Automatically join any group when new user registers in Buddypress


function auto_join_group($user_id, $group_id) {
    if( !$user_id ) return false;

    // Join user to group with group id $group_id
    groups_accept_invite( $user_id, $group_id);
}

add_action( 'bp_core_activated_user', 'auto_join_group' );