HugoDF
3 months ago

Change the date of a git commit

Set the date of the last commit to the current date: GIT_COMMITTER_DATE="$(date)" git commit --amend --no-edit --date "$(date)"

Set the date of the last commit to an arbitrary date: GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" git commit --amend --no-edit --date "Mon 20 Aug 2018 20:19:19 BST"

Set the date of an arbitrary commit to an arbitrary or current date: Rebase to before said commit and stop for amendment + change the date as above. See Change the date of a git commit for full walkthrough of this case.

limitlis
3 months ago

Easy to remember local static web server - httpster

I know there's tons of options out there, but this one is my go-to. Primarily because it's hard to forget, but also has just the right amount of features.

httpster

Install:

npm i -g httpster

Then from any folder you want served, simply:

httpster

Default port is 3333.

Advanced Usage:

With custom port: httpster -p 8080

Declare directory as root: httpster -d /dist

Even more advanced usage, https://github.com/SimbCo/httpster

avgenakisg
3 months ago

Check your battery status and date in your mac

While I create www.loopcv.pro It happens a lot to travel and work from coffee shops. Two commands that I use as aliases are:

1) alias now='cal; date +"%T"; date +"%d-%m-%Y"' which prints the calendar, the date and the time

2) alias bat='pmset -g batt' which prints the battery status and the remaining time!

🚀🚀

Hansum
3 months ago

Stores a string to a variable using scanf in C

You can use "scanf("%d\n,variableName);" to store a string including the space to provide enough memory to the variable. ex:

char name[100];
printf("Enter a name);
scanf("%[^\n]",name);
printf("%s",name);
achuthhadnoor
3 months ago

Save snippets globally to access in any editor or any group

use snipper (https://www.producthunt.com/posts/snipper) app to store global snippets and they are stored right on menubar . you might wonder what would be an alternate to store bash commands well its snip (https://www.producthunt.com/posts/snip)

deamme
3 months ago

VSCode - Code editor

Probably the best code editor out there. It has tons of extensions and is just a joy to work with.

Best theme to have is: https://vscodethemes.com/e/dracula-theme.theme-dracula.

Best font to code with: https://github.com/tonsky/FiraCode

Highlight colors in your code: https://github.com/tonsky/FiraCode

My VSCode settings (very opinionated you probably shouldn't copy everything ): https://github.com/deamme/gatsby-starter-prismic-resume/blob/master/vscode.json

Enjoy an amazing setup!

deamme
3 months ago

DNS troubleshooting

You've setup your dns but it doesn't work. It typically means you've set it up wrong or the dns having propagated to all DNS servers yet.

I use https://dnschecker.org/ to check the DNS propagation and keep track.

AnTheMaker
3 months ago

How do display errors in PHP

Paste these 3 lines of PHP code at the beginning of your PHP-file: (right after <?php) ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

This is just one of many ways to do this but I think it's the easiest solution if you need a quick way to display errors. Just don't forget to remove those lines before using your code in production! ;)

mddanishyusuf
3 months ago

My quick hack to unsubscribe from Spam Email in 1-click

I found a tool LeaveMeAlone on ProductHunt and It's quite awesome that I can unsubscribe without any data leak in 1-click and listed on single page(As they promise).

image

Here you can clean your Spam Emails Today

https://leavemealone.xyz

Booligoosh
3 months ago

A command to give your terminal windows a title

Put this in your bash profile: function title() { echo -e "\033]0;${1:?please specify a title}\007" ; }

Then just type title "myTitle" in the terminal.