Skip to content

Instantly share code, notes, and snippets.

View dlebedynskyi's full-sized avatar

Dima Lebedynskyi dlebedynskyi

View GitHub Profile
@dlebedynskyi
dlebedynskyi / git-apply-patch.md
Last active May 11, 2020 18:07 — forked from emmanueltissera/git-apply-patch.md
Generate a git patch for a specific commit #git

Creating the patch

git format-patch -1 <sha>
OR
git format-patch -1 HEAD

Applying the patch

git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying

/**
`useChangeLog` - dev-mode helper hook to let you
know why a memoized component re-rendered!
Usage example:
const YourComponent = React.memo((props) => {
// Just drop this fella into your memo component's body.
useChangeLog(props);
@dlebedynskyi
dlebedynskyi / operator_with_ligatures.md
Created July 8, 2017 01:48 — forked from renatorib/operator_with_ligatures.md
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@dlebedynskyi
dlebedynskyi / sw-test-cleaup.js
Created March 23, 2017 15:18 — forked from gauntface/sw-test-cleaup.js
Function to unregister SW and clear out old caches.
window.__testCleanup = () => {
const unregisterSW = () => {
return navigator.serviceWorker.getRegistrations()
.then((registrations) => {
const unregisterPromise = registrations.map((registration) => {
return registration.unregister();
});
return Promise.all(unregisterPromise);
});
};