Skip to content

Instantly share code, notes, and snippets.

View wldcordeiro's full-sized avatar

Wellington Cordeiro wldcordeiro

View GitHub Profile
@wldcordeiro
wldcordeiro / rx-5.js
Created April 28, 2018 04:52
converting to RxJS 6
function retryAuth(req$, params) {
return req$.retryWhen(errors =>
errors.mergeMap(error => {
if (error.status === httpStatus.UNAUTHORIZED) {
// If rawAjax is successful, it will retry
return rawAjax({
...params,
url: '/authentication/reup',
}).catch(err => {
// Reupping was not allowed. Redirect to login
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": ["last 2 versions", "not ie < 11"]
},
"modules": false,
"useBuiltIns": true
diff --git a/src/components/QuickOpenModal.css b/src/components/QuickOpenModal.css
new file mode 100644
index 00000000..8de5a216
--- /dev/null
+++ b/src/components/QuickOpenModal.css
@@ -0,0 +1,3 @@
+.result-item .title .matching-character {
+ font-weight: bold;
+}
diff --git a/src/components/QuickOpenModal.js b/src/components/QuickOpenModal.js
// I believe this is doable thanks to the transform-object-rest-spread Babel plugin.
export function formatConditionalAnimals({ bears, cats }) {
return {
animals: {
...(bears != null && { bears }),
...(cats != null && { cats }),
},
}
}
@wldcordeiro
wldcordeiro / parse-moar.patch
Created June 28, 2017 21:08
Parsing more function symbol types
diff --git a/package.json b/package.json
index ad9169df..12e1affd 100644
--- a/package.json
+++ b/package.json
@@ -51,9 +51,9 @@
"@percy-io/react-percy-storybook": "^0.1.11",
"babel-plugin-transform-es2015-modules-commonjs": "^6.22.0",
"babel-preset-react": "^6.24.1",
- "babel-traverse": "^6.22.1",
- "babel-types": "^6.22.0",
const eventMap = {
onClick: 'click',
onChange: 'change',
onKeyDown: 'keydown',
onKeyUp: 'keyup'
}
const ROOT_KEY = '__rektroot_';
const instancesByRootID = {};
let ROOT_ID = 1;
#!/usr/bin/env bash
if npm ls -g --depth=0 --silent | grep lerna; then
npm i jasonlaster/lerna
./node_modules/lerna/bin/lerna.js bootstrap
elif npm ls --depth=0 --silent | grep lerna; then
./node_modules/lerna/bin/lerna.js bootstrap
else
echo "Installing lerna. https://github.com/devtools-html/debugger.html/blob/master/docs/lerna.md"
npm i jasonlaster/lerna
@wldcordeiro
wldcordeiro / style.less
Last active July 28, 2016 17:38
Atom Stylesheet to support Operator and Fira Code together
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@wldcordeiro
wldcordeiro / h.js
Created April 26, 2016 18:25
React h() Function
/* eslint no-param-reassign:0 */
import React from 'react';
import _ from 'lodash';
const classIdSplit = /([\.#]?[a-zA-Z0-9_:-]+)/;
const notClassId = /^\.|#/;
export function h(tagName, properties, children = []) {
/**