This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
".read": "auth.uid !== null && auth.provider === 'google'", | |
".write": "auth.uid !== null && auth.provider === 'google'" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var CreditCardDetector = { | |
blocks: { | |
uatp: [4, 5, 6], | |
amex: [4, 6, 5], | |
diners: [4, 6, 4], | |
discover: [4, 4, 4, 4], | |
mastercard: [4, 4, 4, 4], | |
dankort: [4, 4, 4, 4], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
┌──────────┬──────────────────────────┬──────────────────────────────────────────────────────────────┬────────────┬─────────┬─────────────────────────────────────────────────────────────────────────────────┐ | |
│ Position │ Name │ What for │ Date │ Price │ Receipt │ | |
├──────────┼──────────────────────────┼──────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────────────────────────────────────────────────────────────────────────────┤ | |
│ 16 │ EDUARDO BOLSONARO │ Maintenance of office supporting parliamentary activity │ 2018-08-02 │ 4200 │ http://www.camara.gov.br/cota-parlamentar/documentos/publ/2907/2018/6649961.pdf │ | |
├──────────┼──────────────────────────┼──────────────────────────────────────────────────────────────┼────────────┼─────────┼─────────────────────────────────────────────────────────────────── |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* prepareDom method | |
* | |
* just creates the DOM structure needed to render | |
* this application before running tests. | |
* | |
* it is needed to test the `index.js` file of the project. | |
*/ | |
(function prepareDom() { | |
document.body.innerHTML = '<div id="root"></div>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* window.matchMedia mock | |
* | |
* it also exposes a custom global method called setMatchMediaProperties | |
* that accepts an object as parameter to merge with the default MatchMedia properties. | |
*/ | |
(function matchMediaMock() { | |
const defaultMatchMedia = { | |
matches: false, | |
addListener() {}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "ES6", | |
"module": "commonjs", | |
"allowSyntheticDefaultImports": true, | |
"baseUrl": "./", | |
"paths": { | |
"Api/*": ["./src/api/*"], | |
"Components/*": ["./src/components/*"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const paginate = (array, pageSize) => { | |
const numberOfPages = Math.round(array.length / pageSize); | |
const needsOneMorePage = array.length % pageSize; | |
const totalNumberOfPages = needsOneMorePage | |
? numberOfPages + 1 | |
: numberOfPages; | |
const iterableNumberOfPages = [ | |
...Array(totalNumberOfPages).keys() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace the path for LLVM and Emscripten for these: | |
EMSCRIPTEN_ROOT = os.path.expanduser( | |
os.getenv('EMSCRIPTEN') or | |
'/usr/local/opt/emscripten/libexec') | |
LLVM_ROOT = os.path.expanduser( | |
os.getenv('LLVM') or | |
'/usr/local/opt/emscripten/libexec/llvm/bin') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
const hasDataForThisKey = (staticContext) => | |
(key) => staticContext && Object.keys(staticContext.data).includes(key); | |
const windowHasDataForThisKey = (window) => | |
(key) => Object.keys(window.__DATA__).includes(key); | |
export default ({ | |
key, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s \ | |
-H "Accept: application/json" \ | |
-H "Content-Type:application/json" \ | |
-X PUT --data '{ "name": "username_user", "password": "password_here" }' \ | |
https://registry.npmjs.org/-/user/org.couchdb.user:username_user |