This file contains 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
class Printer { | |
constructor(name) { | |
this.name = name; | |
} | |
} | |
class AllInOne extends Printer { | |
constructor(name) { | |
super(name); | |
} |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<ul> |
This file contains 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
/** | |
* A simple circular data structure | |
*/ | |
function Circular(arr, startIntex){ | |
this.arr = arr; | |
this.currentIndex = startIntex || 0; | |
} | |
Circular.prototype.next = function(){ | |
var i = this.currentIndex, arr = this.arr; |
This file contains 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
# | |
# Script feito para alterar a versão do node nos projetos com serverless. | |
# | |
# Para executar abra o terminal e execute o comando: | |
# bash <(curl -Ls https://gist.githubusercontent.com/felipecesr/839f40f52b4db733564d97faf1319f9e/raw/43ea30fab7bf01917dd5069c032703b381cefd93/node_version.sh) | |
# | |
read -p "Enter the Node.js version (e.g. 12) : " node_version | |
sed -i -E "s/nodejs[0-9]+\.x/nodejs$node_version.x/g" serverless.yml |
This file contains 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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Card } from '../src/Card'; | |
describe('Card', () => { | |
let container; | |
let user; | |
beforeEach(() => { | |
container = document.createElement('div'); |
This file contains 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
export const Card = ({ user }) => ( | |
<div>{user.name}</div> | |
); |
This file contains 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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Card } from '../src/Card'; | |
describe('Card', () => { | |
it('renders the user name', () => { | |
const user = { name: 'John Wick' }; | |
const component = <Card user={user} />; | |
const container = document.createElement('div'); |
This file contains 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
// Card.js | |
import React from 'react'; | |
export const Card = () => <div>John Wick</div>; | |
// Card.test.js | |
import { Card } from '../src/Card'; |
This file contains 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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
describe('Card', () => { | |
it('renders the user name', () => { | |
const user = { name: 'John Wick' }; | |
const component = <Card user={user} />; | |
const container = document.createElement('div'); | |
ReactDOM.render(component, container); |
This file contains 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
export class HttpClient { | |
get(url) { | |
return fetch(url).then(response => response.json()); | |
} | |
} |
NewerOlder