Skip to content

Instantly share code, notes, and snippets.

View ChellappanRajan's full-sized avatar
🎯
Focusing

Chellappan ChellappanRajan

🎯
Focusing
  • Caterpillar
  • Colachel
  • 17:11 (UTC -12:00)
  • X @che_off
View GitHub Profile
@ChellappanRajan
ChellappanRajan / gist:d47928250015e2f4284df5100aa2a962
Created April 4, 2024 02:37
Angular Zone Js Disable patching specific API
index.html
<script>
__Zone_disable_Error = true; // Zone will not patch Error
//https://github.com/angular/angular/blob/main/packages/zone.js/MODULE.md
</script>

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@ChellappanRajan
ChellappanRajan / IndianStatesDistricts.json
Created May 7, 2021 17:49 — forked from Dhaneshmonds/IndianStatesDistricts.json
Indian states, capitals and districts
{
"states": [
{
"id": "1",
"type": "Union Territory",
"capital": "Mayabunder",
"code": "AN",
"name": "Andaman and Nicobar Islands",
"districts": [
{
@ChellappanRajan
ChellappanRajan / event-loop.md
Created April 12, 2021 09:24 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

const first = getBoundingClientRect(elm);
doSomething();
const last = getBoundingClientRect(elm);
const deltaX = first.left - last.left;
const deltaY = first.top - last.top;
const deltaW = first.width / last.width;
const deltaH = first.height / last.height;
- Allow only 2 digit decimal point following 3 digit number.
/^\d{0,3}(\.\d{1,2})?$/
- Allow English Alphabets (A-Z) and Numbers and Special Characters ('-@&#*_)
/^[ A-Za-z0-9_@#&'*-]*$/
- Add - or some delimeter to number
var str = 'habc123def';
str = str.replace(/(?=(.{3})+$)/gm, ".");
@ChellappanRajan
ChellappanRajan / jquery-scroll-bottom.js
Created January 7, 2019 10:45 — forked from toshimaru/jquery-scroll-bottom.js
Detect the scrolling to bottom of the page using jQuery.
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});