GraemeFulton
a month 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

matteing
a month ago

Pick hex colors on Mac with ease!

macOS has a hidden color selector you can use to quickly grab the hex color of anything on screen! 🎨

  1. Open "Digital Color Meter"
  2. Set "display values" as "hexadecimal"
  3. Shift-Command-C to copy colors! ✨🥰
chandrasd
2 months ago

How to get your SSH Keys from GitHub

Get your public SSH keys from GitHub

https://github.com/username.keys

Replace "username" with actual GitHub username Source

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

fajarsiddiqfs
2 months ago

How to add EMOJI + TWITTER THREAD ?

  1. create emoji by typing :
    https://matthewpalmer.net/rocket

  2. you can thread by click +

mddanishyusuf
2 months ago

🛠️ Build Simple JSON API

Last week I build an tool to make quick JSON API for quick use and host them on GitHub Repository.

Here is the tool: https://apiwithgithub.com

Tool Demo

📢 Good New is it's open source project: https://github.com/mddanishyusuf/json-apis-with-github

mddanishyusuf
3 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
3 months ago

Render JSON objects in React Component

In Angular it's easy to view JSON object just bind like this.

<pre>
{{jsonObject | json}}
</pre>

In React You have to stringify first to the JSON object.

<pre>
  <code>
    {JSON.stringify(this.state.json, null, 2)}
  </code>
</pre>

How you render JSON object in React. Comment your trick.

mddanishyusuf
3 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)

willhoag
3 months ago

Quick React-like API for adding html to a page in plain JS

I use this when need to quickly add some HTML to a page programmatically.

Code is:

function el (type, attrs, children) {
  children = children || []
  attrs = attrs || {}
  var e = document.createElement(type)
  Object.keys(attrs).forEach(function (key) {
    e.setAttribute(key, attrs[key])
  })
  children.forEach(function (child) {
    if (typeof child === 'string') {
      if (e.textContent) {
        e.textContent = child
      } else {
        e.innerHTML = child
      }
    } else {
      e.appendChild(child)
    }
  })
  return e
}

And usage:

const newElement = (
  el('div', { className: 'bold' }, [
    el('p', {}, ['here is text in a paragraph'])
  ])
)

document.appendChild(newElement)
Load More