Skip to content

Instantly share code, notes, and snippets.

View wldcordeiro's full-sized avatar

Wellington Cordeiro wldcordeiro

View GitHub Profile
Reading manifest: Error processing permissions.1: Value "background" must either: must either [must either [be one of ["clipboardRead", "clipboardWrite", "geolocation", "idle", "notifications"], be one of ["bookmarks"], be one of ["history"], be one of ["find"], be one of ["menus.overrideContext"], be one of ["search"], be one of ["activeTab", "tabs", "tabHide"], be one of ["browserSettings"], be one of ["cookies"], be one of ["downloads", "downloads.open"], be one of ["topSites"], be one of ["webNavigation"], or be one of ["webRequest", "webRequestBlocking"]], be one of ["alarms", "mozillaAddons", "storage", "unlimitedStorage"], be one of ["browsingData"], be one of ["devtools"], be one of ["identity"], be one of ["menus", "contextMenus"], be one of ["pkcs11"], be one of ["geckoProfiler"], be one of ["sessions"], be one of ["contextualIdentities"], be one of ["dns"], be one of ["management"], be one of ["privacy"], be one of ["proxy"], be one of ["nativeMessaging"], be one of ["telemetry"], be one of ["theme
@wldcordeiro
wldcordeiro / thunk.js
Created April 4, 2019 01:33
Polling in Redux Thunk
function polling(tries) {
return async (dispatch, getState) => {
const result = await Promise.all([
loadIntegrations(), // calling fetch()
getAllEnabledCalendarEvents(), // calling fetch()
]);
if (Array.isArray(result)) {
if (
result[0].every((calendar) => calendar.name && calendar.id) &&
areDifferentBy(getState().time.integratedCalendars, result[0])
@wldcordeiro
wldcordeiro / with-slide.js
Created August 8, 2018 00:10
Transitions and Stuffz
import React, { Component } from 'react'
import { bool, func, number, oneOf, oneOfType, shape, string } from 'prop-types'
import { Transition } from 'react-transition-group'
import stringify from 'json-stable-stringify'
function parseAmount(amount) {
if (typeof amount === 'object') {
return {
in: amount.in != null ? amount.in : 100,
out: amount.out != null ? amount.out : 0,
@wldcordeiro
wldcordeiro / sliding-container.js
Created August 8, 2018 00:05
Using react-transition-group
import React from 'react'
import { bool, element, oneOf } from 'prop-types'
import { css } from 'glamor'
import { Transition } from 'react-transition-group'
import { wrapperStyle } from './styles'
const transInfo = '250ms cubic-bezier(0.07, 0.95, 0, 1)'
const baseSlideStyle = {
transition: `opacity ${transInfo}, transform ${transInfo}`,

Component Description

Write a high level overview of what it's for.

Usage Example

<MyComponent onClick={doSomething}/>
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const config = require('./env.config')
const { AUTHM_GATEWAY_URL, DAM_ROOT_PATH } = config
const rewriteRegex = new RegExp(`^${DAM_ROOT_PATH}/.`)
module.exports = merge(common, {
const merge = require('webpack-merge')
const convert = require('koa-connect')
const history = require('connect-history-api-fallback')
const proxy = require('http-proxy-middleware')
const common = require('./webpack.common.js')
const config = require('./env.config')
const { AUTHM_GATEWAY_URL, DAM_ROOT_PATH } = config
@wldcordeiro
wldcordeiro / jest-eslint.config.js
Created May 25, 2018 02:44
Jest Multi Project Example
const { resolve } = require('path')
const root = resolve(__dirname, '..')
module.exports = {
rootDir: root,
displayName: 'eslint',
runner: 'jest-runner-eslint',
testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/config/*.js'],
}
@wldcordeiro
wldcordeiro / actions.js
Created May 9, 2018 01:58
Conductor Epics
export const ORCHESTRATION_CLEAR = 'orchestration/CLEAR'
export function clearOrchestration(id) {
return { type: ORCHESTRATION_CLEAR, id }
}
export const ORCHESTRATION_PROGRESS = 'orchestration/PROGRESS'
export function orchestrationProgress(initAction, state) {
return { type: ORCHESTRATION_PROGRESS, initAction, state }
}
@wldcordeiro
wldcordeiro / rx-6.js
Created April 28, 2018 17:31
TypeError?
import { from } from 'rxjs'
// This is the observable that is going to be emitted once the connection/subscription has been made. This will need to be subscribed to in order to receive actual messages.
const listener = client =>
// This used to be Observable.create(observer => ...)
from(observer => {
client.on('message', (topic, message) =>
observer.next(JSON.parse(message.toString()))
)
return () => {