2 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 Documents

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

2 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.


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.

2 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

2 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.


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%;


2 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
2 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.

2 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!

2 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.


Install: npm i -g taskbook

To check the commands: taskbook --help

2 months ago

live-server: use for small development to serve app in browser

I'm using live-server to serve my simple pages in the browser with the PORT and it supports live reload mean whenever you change in your file the server will refresh the page.


npm i -g live-server

2 months ago

Screen Mailer: record, upload & share link

This is my best tool to share the screen of my machine(browser+system). So, It's just record and instant upload their server and then it will give you a link to share.


Screenshot Capture - 2019-03-27 - 00-36-42