Wednesday, 2 May 2018

macOS shortcuts

option + p - Pi π

option +f - ƒ

option + z : Ω Omega

option + divison :√

option + b - Integration ∫

option + m -mu µ

Similarly for other letter with option key
  
Frequently used

fn+ delete key - delete one character on right side of cursor

option + 3 - For # (hash)

(Command key, ⌘, formerly also known as the Apple key)

Command + M - Minimise Window


Camtasia 
Shift + Command + 2 - Start recording

Monday, 26 March 2018

UNIX Commands

mkdir folderName
cd folderName
To go back
cd ..
vi filename.txt
Esc :wq
clear
whoami
cat filename.txt   #output the contents of file

Find out nth Maximum Salary

Logic
  1. Get salary in decreasing order and give limit n. So, the last salary is required 
  2. Now arrange this is increasing order (ascending order)
  3. Take the first record by using Limit 1, to get the answer
mysql> select * from emp;
+--------+
| salary |
+--------+
|  20000 |
|  50000 |
|  35000 |
|  60000 |
+--------+
Ques - Find 3rd max salary

mysql> select salary from emp order by salary desc limit 3;
+--------+
| salary |
+--------+
|  60000 |
|  50000 |
|  35000 |
+--------+
3 rows in set (0.00 sec)

mysql>  select salary from (select salary from emp order by salary desc limit 3) a order by salary
    -> ;
+--------+
| salary |
+--------+
|  35000 |
|  50000 |
|  60000 |
+--------+
3 rows in set (0.00 sec)

mysql> select salary from (select salary from emp order by salary desc limit 3) a order by salary limit 1;
+--------+
| salary |
+--------+
|  35000 |
+--------+
1 row in set (0.00 sec)
--------------------------------------------------------------------------------------------------------------------------
Ques -  find 2nd min salary = 35000


mysql> select * from emp order by salary limit 2;
asc - first min sal , second min sal
+--------+
| salary |
+--------+
|  20000 |
|  35000 |
+--------+
2 rows in set (0.00 sec)

mysql> select salary from (select salary from emp order by salary limit 2)a order by salary desc ;
+--------+
| salary |
+--------+
|  35000 |
|  20000 |
+--------+
2 rows in set (0.00 sec)

mysql> select salary from (select salary from emp order by salary limit 2)a order by salary desc limit 1 ;
+--------+
| salary |
+--------+
|  35000 |
+--------+
1 row in set (0.00 sec)

Monday, 12 March 2018

Tinder swipe right script

Open Console and run this script

a = setInterval(function(){
    var o = document.getElementsByClassName("recsGamepad__button--like");
    o[0].click();
}, 2000)

Friday, 23 February 2018

Google chrome shortcuts

Ctrl + click - Open link in new tab

Shift + click - Open link in new window