Skip to content

Instantly share code, notes, and snippets.

View AbhishekThorat's full-sized avatar

Abhishek Thorat AbhishekThorat

View GitHub Profile
@AbhishekThorat
AbhishekThorat / what-forces-layout.md
Created December 4, 2018 10:11 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@AbhishekThorat
AbhishekThorat / git_logs_between_2_commits.md
Created November 22, 2018 05:46 — forked from zulhfreelancer/git_logs_between_2_commits.md
How to see Git logs between 2 commits?
git log --oneline 7de7970..master

OR

git log --oneline 7de7970..4cb34a9

Above command will give all logs between commit A and commit B including commit A and commit B.

#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@AbhishekThorat
AbhishekThorat / ISODate.txt
Created August 10, 2018 11:38
Create a ISO date using moment by ignoring current timezone.
`${moment(date).format('YYYY-MM-DD')}${moment(date).format('Thh:mm:ss')}.000Z`
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { accessor } from 'react-big-calendar/lib/utils/accessors';
import { accessor as accessorPropType } from 'react-big-calendar/lib/utils/propTypes';
import { noop } from 'lodash';
import { zonedToLocal, localToZoned } from '/client/utils/timezones';
import { hasTime, shiftDate, shiftHour } from '/client/utils/date';
/**
* withTimeZone - HOC to add time zone support to react-big-calendar