mddanishyusuf
5 months ago

Watch YouTube videos when I do code

I'm using a hack to play YouTube Videos sometime while I do code. This trick is working on MacOs.

double click on video and then click Picture in Picture. that's all.

Here is the tutorial video. https://www.screenmailer.com/v/inteXOAnG0MaqT8

(via) @levelsio

FabioRosado
5 months ago

Copy the ssh key id_rsa.pub directly from the terminal

You don't need to copy and paste the key to the machine you want to connect to another. All you have to do is generate your key and then type this command on the terminal:

ssh-copy-id <username>@<ipaddress/host>

You will be prompt to type in the username password and then the key will be copied, you can now log into the machine by using the command ssh <username>@<ipaddress/host>

FabioRosado
6 months ago

Get last typed command on terminal

You can run the last typed command in the terminal by using !!.

Let's say that your history looks like this:

cd
ls
cd Documents
ls

if you type !! the last command (ls) will be auto-filled in the terminal for you.

But you can also get more specific, by using !<term> so you could use !cd to get the last cd command which was cd Documents

FabioRosado
6 months ago

Search previous typed command on terminal

If you press ctrl+r in the terminal you will activate the reverse-i-search. With it, you can search your whole history for a command. If you type very long commands you or if you don't remember the whole command that you typed you can just press ctrl+r and type the bit you remember, the command that matches will show up.

If you want to search it again all you need to do is press ctrl+r again.

Example

Let's say you used the command git rebase -i Head~2 before, but you don't remember what does after git rebase or you just don't feel like typing the whole thing.

Press ctrl+r and then type git re if git rebase -i Head~2 was the last command that you used, it will be shown. Then just press enter to run the command.

FabioRosado
6 months ago

Vim: Search for a term

When editing a long file with vim, you might need to try and find a certain word or term, but scrolling down is not really practical.

Luckily, Vim has your back and you can just use these two commands to search for a term through the whole file.

  • :?<term>
    • searches for that term from the cursor down
  • :\<term>
    • searches for that term from the cursor up

If you want to cycle through different occurrences of the same term you can use: - n or / - go to the next searched term - N or ? - go to the previous searched term

mddanishyusuf
6 months ago

CSS border awesome tricks

I found this CSS tricks to rounded the box in one CSS code. Here I'm sharing a codepen.io link.

https://codepen.io/mddanishyusuf/pen/GLKwpx

Pattern: border-radius: <horizontal radius> / <vertical radius>

  1. border-radius: 60px 45px 30px 15px/15px 30px 45px 60px;
  2. border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  3. border-radius: 50% 40% 45% 50% / 40% 50% 55% 40%;
  4. border-radius: 50% 50% 40% 40% / 60% 60% 20% 30%;

image

mohdluqman
6 months ago

[Compress Image] Compress your image for the web

Often frontend developers need to deal with lots of images. The image should have the best quality, appropriate dimensions & low file size. The tools that I often use to compress images are (get more details from here)

  1. jpegtran: for JPEG image optimization
  2. gifsicle: suitable for GIF images
  3. optipng: lossless PNG image optimization
  4. pngquant: lossy PNG image optimization
mddanishyusuf
6 months ago

Next.js Application Deploy on Zeit

I'm using Zeit service to host my Next.js Application because it's easy to maintain and deploy.

  1. First, just run this command(now-cli is required for this) now

  2. When now command done you will get the deployment URL. that URL changed every time when you make a new deploy. So, this way your production application will not affect. that mean alias is not assigned to the latest deployment URL. Cool!!!

  3. So, if you seem that latest deployment is good to go on production then you just have to assign the alias to this deployment URL. now alias <deployment URL> <domain> like this: now alias dailyhack-3c1tmk4cu.now.sh dailyhack.xyz

that's all.

remotealex
6 months ago

Alfred app

Massive productivity boost with https://www.alfredapp.com/

Quick app switching, built in clipboard and snippet management plus it pulls in contacts and search. It's a beast for MacOS!

mddanishyusuf
6 months ago

Taskbook: track all my todos in terminal.

I found this tool on ProductHunt and it's quite interesting and hacky tool. So, I'm using this tool in my daily hack.

Taskbook

Install: npm i -g taskbook

To check the commands: taskbook --help