How to Create Symlink on Windows

A symlink is an acronym for a symbolic link. It is a shortcut to a targeted file/folder.

 

Here is how it works.

I was working on a project for which I have to work both at home and in office. One was a MacBook with MAMP and the other was a PC with XAMPP installed. So the files are in MAMP and XAMPP. With the help of symlink, I kept the files in my Dropbox although it seems if it’s in both MAMP and XAMPP. Meaning that all the files are synced through Dropbox. Thank God 🙂

 

Here’s how to do that on Windows.

Create a symlink to a file:

mklink Link Target

Use /D when you want to create a soft link pointing to a directory. like so:

mklink /D Link Target

Use /H when you want to create a hard link pointing to a file:

mklink /H Link Target

Use /J to create a hard link pointing to a directory, also known as a directory junction:

mklink /J Link Target

So, for example, if you wanted to create a hard link at C:\LinkToFolder that pointed to C:\Users\Name\OriginalFolder, you’d run the following command:

mklink /J C:\LinkToFolder C:\Users\Name\OriginalFolder

You’ll need to put quotation marks around paths with spaces. For example, if the folders are instead named C:\Link To Folder and C:\Users\Name\Original Folder, you’d use the following command instead:

mklink /J "C:\Link To Folder" "C:\Users\Name\Original Folder"

Translate month name in WordPress

In WordPress, you might want to rename posts’ month name from English to Dhivehi or whatever language. This is a very simple function which will help you change the posts’ month name.

Put this into your function.php

function mas($month) {
switch ($month) {
case 1:
    $mas = "ޖަނަވަރީ";
    break;
case 2:
    $mas = "ފެބުރުވަރީ";
    break;
case 3:
    $mas = "މާރިޗު";
    break;
case 4:
    $mas = "އެޕްރީލް";
    break;
case 5:
    $mas = "މެއި";
    break;
case 6:
    $mas = "ޖޫން";
    break;
case 7:
    $mas = "ޖުލައި";
    break;
case 8:
    $mas = "އޯގަސްޓު";
    break;
case 9:
    $mas = "ސެޕްޓެންބަރު";
    break;
case 10:
    $mas = "އޮކްޓޯބަރު";
    break;
case 11:
    $mas = "ނޮވެންބަރު";
    break;
case 12:
    $mas = "ޑިސެންބަރު";
    break;
}
return($mas); }

 

And use this wherever you want to view the date in Dhivehi.

<?php echo mas(get_the_date('n')); ?>

Create random text on MS Word

Sometimes you have to search the web to get some random text. Well not after you read this tip.

type =rand(3,6) and press enter.

That’s it, likewise, you create random text in a word document. Read below for further explanation on the function.

=rand(P,S)

rand represents random.
P should be replaced with a number of paragraphs you want to create.
S should be replaced with a number of sentences in each paragraph.

So it is as

=rand(Number of Paragraphs, Number of Sentences in each paragraph)

This trick is usually handy for tutors who wants to type some random text to demonstrate something with some random text. Mostly used by web developers to show sample text in templates. Web developers or designers use something like “Lorem ipsum…” to fill and demonstrate their design.

For those who want to print something like “Lorem ipsum…” in their word document can use “lorem” instead of rand as shown below:

lorem(3,6)

or you can use:

rand.old(3,6)

Also, you can skip the number of paragraph and number of sentences and use it as rand() or lorem() or rand.old()

Check how old you iPhone is

It is normal that sellers buy used phones then refurbish and pack and wrap the phone in a new fake box. So that it looks like a brand new original iPhone.

But don’t be fooled, check the age of the phone before you purchase.

Here you will learn to check for how long a phone has been used.

Go to imeipro and enter your iPhone IMEI number.

That’s all. Read further for more info.

Here’s how to get IMEI Number:

  • Open Settings.
  • Tap General > About.
  • Scroll down to locate the IMEI number.
  • Tap and hold the IMEI number to bring up a Copy bubble.
  • Tap Copy.

If you want to Check Your Service and Support Coverage via apple website go to Apple Check Coverage page, but it doesn’t show the approximate age of the phone like in imeipro.

Besides iPhone, you can also check Samsung, Microsoft, Lenovo, Nokia and other phones too.

Learn HTML & CSS

If you are a beginner first and foremost we have to learn HTML and CSS. This is a must step and cannot be skipped as HTML and CSS have no alternative. And we can’t develop a website without HTML and CSS.

So let’s start with the first step.

first, we need <!doctype html> which declares the DOCTYPE for HTML5 and happily is not case-sensitive.

Now we can open <html> and <body> tag. So it will look something like this:

<!doctype html>
<html>
<body>
</body>
</html>

It is still empty. So let’s add up a title (which will be shown in the browsers tag) and some body text.

<!doctype html>
<html>
<title>YOUR PAGE TITLE GOES HERE</title>
<body>
BODY TEXT COMES HERE.
</body>
</html>

Copy & paste the code into a text editor and save it as “index.html”.

Go to the directory where you saved the file and open it in a browser. In Brackets you can do it by simply clicking the Live Preview (thunderbolt) icon in the top-right corner.