danedavid
5 days ago

UTC to Local time converter for AWS OpsWorks

Problem: Difficult to keep track of deployments in AWS OpsWorks as the deployment times are in UTC.

Solution: Google Chrome Extension to convert all times displayed to local time.

Screenshot 2019-08-25 at 2 26 27 PM

Link: https://github.com/danedavid/AWS-time-converter

GraemeFulton
3 months ago

CSS hack for quickly resizing images for mobile devices

Use object-fit cover on your images for a quick way to resize images without ruining proportions... @media (max-width: 540px) { img{ max-height:200px; max-width:100%; object-fit:cover; } }

Here's a demo: https://twitter.com/graeme_fulton/status/1137409649857220608

naquiuddin
3 months ago

Snippets are awesome. Creating one is painful. This saves time.

We sometimes write the same code multiple times. For example Configs (related to webpack bable, prettier, eslint etc), frequently used react component code and other boiler plate code.

Some of us store them in GitHub's Gists, but have to copy paste it when required. Snippets are handy shortcuts to generate code for us. For example if you type imp in VS Code's JavaScript file, it automatically creates import <some space> from '<cursor shows here>'. You can type the package name and then press tab to automatically move cursor to another step. Just try it yourself.

We can create our own custom snippets for frequently written code to increase productivity. However writing it is painful. So here is a handy tool that creates snippet for you.

This tool works for sublime, atom and VS Code. However I like VS Code so this one is mostly about it.

https://snippet-generator.app/

Just copy paste your code on left side. Add $1 for first tab, $2 for second tab and so on. On the right side you will see snippets generated automatically for you.

After that Go to 'Preferences' > 'User snippets' and select the correct type, then paste in the copied code. Discover more from the VS Code snippets docs.

mddanishyusuf
4 months ago

Download video/gif in any tweet

Awesome Trick: Wanna download video or gif from twitter tweets? it's easy just mention and twitter handle.

@GetVideoBot

image

mddanishyusuf
4 months ago

Make ascii tables super easy with terminaltables

How to make ASCII tables with a simple Python library.

Like this:

image

Use this Pythin Library: https://pypi.org/project/terminaltables/

Suggested by @sergio

mddanishyusuf
5 months ago

If-None-Match Header config saved my day

I'm building an small project with GitHub APIs and by default this is the config Cache-Control: public, max-age=60, s-maxage=60

Means GitHub APIs will be cache for next 60 sec of the call. I can't wait for that So, I google to find a solution and I found this https://github.com/octokit/rest.js/issues/890#issuecomment-392193948

Just use a basic config 'If-None-Match': '' in header and that's all.

Like this.

axios.get(url, {header: {'If-None-Match': ''}})

mddanishyusuf
5 months ago

Get GitHub Profile Pic URL

I just leanred this hack that you can get your GitHub Profile Photo URL by adding .png in the last of your github profile URL. Like this.

GitHub Profile: https://github.com/mddanihyusuf

GitHub Profile Pic URL: https://github.com/mddanishyusuf.png

Source(https://twitter.com/holman/status/1118184832637423621)

mddanishyusuf
5 months ago

Design an input box with search emoji

Recently I add search input box into dailyhack.xyz and without search icon the input doesn't feel good according to UX. So, to add a icon inside input box need more element and CSS. Nowadays I'm using lots of emoji and I think why not use a little hack to design this search input box without any extra element and CSS. Here is the hack.

<input type="text" placeholder="🔍 Let's find some tricks from past"/>

input-with-emoji

So, I'm adding a search emoji into placeholder of the input box.

What you think? is this cool hack?

HugoDF
5 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.

Load More