Skip to content

Instantly share code, notes, and snippets.

View jasim's full-sized avatar

Jasim A Basheer jasim

View GitHub Profile
@jasim
jasim / todo_cli_coronasafe.js
Created January 30, 2021 11:42
A possible solution for the CoronaSafe Fellowship Todo CLI application
/*
https://fullstack.pupilfirst.org
https://github.com/nseadlc-2020/package-todo-cli-task/tree/master/shared
*/
const EOL = require('os').EOL
const fs = require('fs')
const PENDING_TODOS_FILE = 'todo.txt'
const COMPLETED_TODOS_FILE = 'done.txt'
@jasim
jasim / js-css-postcss-cra.md
Created March 3, 2021 08:16
JavaScript CSS PostCSS Source-to-Source Compilers

The JavaScript CSS Mess

CSS is simple: you have a .css file, you include it in your HTML, and all the styling gets applied to it.

However: CSS evolves rapidly and browsers often can’t keep up..

Autoprefixer

For example the current box-shadow property was first implemented only in Chrome, and that property was called -webkit-box-shadow. This is a convention that browser vendors follow when they implement their own browser-specific CSS properties.

@jasim
jasim / NoScrollOnInputFocusiOSSafari.html
Created July 7, 2023 16:43 — forked from kiding/NoScrollOnInputFocusiOSSafari.html
Preventing iOS Safari scrolling when focusing on input elements
<!--
When an input element gets focused, iOS Safari tries to put it in the center by scrolling (and zooming.)
Zooming can be easily disabled using a meta tag, but the scrolling hasn't been quite easy.
The main quirk (I think) is that iOS Safari changes viewport when scrolling; i.e., toolbars shrink.
Since the viewport _should_ change, it thinks the input _will_ move, so it _should_ scroll, always.
Even times when it doesn't need to scroll—the input is fixed, all we need is the keyboard—
the window always scrolls _up and down_ resulting in some janky animation.
However, iOS Safari doesn't scroll when the input **has opacity of 0 or is completely clipped.**