Skip to content

Instantly share code, notes, and snippets.

View anuragl94's full-sized avatar

Anurag Lingam anuragl94

  • Bangalore
View GitHub Profile
@anuragl94
anuragl94 / message_format_examples.md
Last active June 26, 2018 13:14
Examples of ICU MessageFormat strings

1. Simple string substitution

String

Hello, {USERNAME}!

Output

// For USERNAME = "Anurag"
Hello, Anurag
@anuragl94
anuragl94 / react-15.6.2-to-16.2.0.md
Last active March 29, 2018 05:03
Highlights of migrating React from v15.6.2 to v16.2.0

1. Hard requirements (can be polyfilled)

  1. Collection types Map and Set
  2. window.requestAnimationFrame function

2. Deprecations (no more notices)

  1. react-with-addons.js is removed
  2. React.createClass replaced with create-react-class
  3. React.PropTypes as prop-types replaced with prop-types

3. Breaking changes

@anuragl94
anuragl94 / ghost-cursor.js
Last active March 26, 2018 11:18
Ghost cursor
(function () {
if (!window._shadowCursor) {
window._shadowCursor = document.createElement("img");
document.body.appendChild(window._shadowCursor);
window._shadowCursor.style = `
height: 32px;
width: 32px;
position: fixed;
z-index: 99999999;
@anuragl94
anuragl94 / debug-grid-bookmarklet.md
Last active March 23, 2018 04:41
Bookmarklet to toggle a debug grid on a webpage

JS Snippet

Here is the JS snippet that you can execute in the console window to toggle a debug grid on your page:

(function() {
    if (!window._DebugGrid) {
        window._DebugGrid = document.createElement('div');
        window._DebugGrid.style = `
	    display: none;
	    top: 0;
	    left: 0;