Skip to content

Instantly share code, notes, and snippets.

View manjula-dube's full-sized avatar
🎯
Focusing

Manjula Subhashchandra Dube manjula-dube

🎯
Focusing
View GitHub Profile
// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content/
// See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
@manjula-dube
manjula-dube / hooksCounter.js
Last active March 31, 2019 16:05
hooksCounter.js
!(function(e) {
function t(t) {
for (var n, l, i = t[0], a = t[1], f = t[2], d = 0, p = []; d < i.length; d++)
(l = i[d]), u[l] && p.push(u[l][0]), (u[l] = 0);
for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n]);
for (c && c(t); p.length; ) p.shift()();
return o.push.apply(o, f || []), r();
}
function r() {
for (var e, t = 0; t < o.length; t++) {
!(function(e) {
function t(t) {
for (var r, a, c = t[0], l = t[1], i = t[2], s = 0, p = []; s < c.length; s++)
(a = c[s]), o[a] && p.push(o[a][0]), (o[a] = 0);
for (r in l) Object.prototype.hasOwnProperty.call(l, r) && (e[r] = l[r]);
for (f && f(t); p.length; ) p.shift()();
return u.push.apply(u, i || []), n();
}
function n() {
for (var e, t = 0; t < u.length; t++) {
const myArray = ['manjula','26','Software Engineer']
myArray[2] = myArray
const myArray1 = [ 1 , 'a' , { data : 'manjula'}]
myArray1[2].parent = myArray1
function encodeCycles(input) {
if(typeof input !== 'object') {
return input
@manjula-dube
manjula-dube / .eslintrc.js
Created February 6, 2018 15:55
.eslintrc.js
// use this format since .eslintrc is deprecated.
// You can logically derive this format.
module.exports = {
parser: 'babel-eslint',
extends: [
'plugin:flowtype/recommended',
'plugin:jest/recommended',
'plugin:react/recommended',
'eslint-config-airbnb',
@manjula-dube
manjula-dube / .eslintrc.js
Created February 6, 2018 15:55
.eslintrc.js
// use this format since .eslintrc is deprecated.
// You can logically derive this format.
module.exports = {
parser: 'babel-eslint',
extends: [
'plugin:flowtype/recommended',
'plugin:jest/recommended',
'plugin:react/recommended',
'eslint-config-airbnb',
@manjula-dube
manjula-dube / .eslintrc.js
Created February 6, 2018 15:55
.eslintrc.js
// use this format since .eslintrc is deprecated.
// You can logically derive this format.
module.exports = {
parser: 'babel-eslint',
extends: [
'plugin:flowtype/recommended',
'plugin:jest/recommended',
'plugin:react/recommended',
'eslint-config-airbnb',
@manjula-dube
manjula-dube / ReactiveConf-CFP.md
Last active January 5, 2024 20:17
CFP: Reactive Conf: Jest & Enzyme complement each other.
This is a proposal for ReactiveConf 2017 open call for Lightning talks. If you'd like to make this talk happen, please 🌟 this gist and retweet my tweet. 🙏

If you're on your phone, please request the 🖥 desktop site to star this gist 😇

I would talk about some myths on Jest & Enzyme. Moreover to stop the comparison of Jest and Enzyme. Instead would focus on how they can work together to test well your React Components. The talk would focus on "How Jest and Enzyme complement each other" and can help you test React components in a better way.

  1. If you are writing tests: you are already winning.
  2. If you are not writing tests:let me encourage you to start.
  3. Jest.
  4. Snapshot Testing.
@manjula-dube
manjula-dube / alternative.md
Created January 26, 2017 14:35 — forked from threepointone/alternative.md
list of things that don't do what they say they do

(also know as lies and/or alternative facts)

js

  • setImmediate - doesn't set anything immediately, waits for a tick before executing
  • setTimeout(fn, n) - never sets the timeout to exactly n
  • Math.random() - computers cannot generate random numbers
  • Promise - is a lie when rejected
  • Array.reduce - accumulates, does not reduce (via @sbmadhav)
@manjula-dube
manjula-dube / LinkedList.js
Created January 25, 2017 18:49 — forked from wesleyhales/LinkedList.js
JavaScript LinkedList Example
//I wanted a more elegant linkedlist example than the others, so purely for academic purposes I created one.
var LinkedList = function(e){
var that = {}, first, last;
that.push = function(value){
var node = new Node(value);
if(first == null){
first = last = node;