Skip to content

Instantly share code, notes, and snippets.

View jmlavoier's full-sized avatar
🏠
Working from home

João Lavoier jmlavoier

🏠
Working from home
View GitHub Profile

Raffa

Raffa, fiz um script pra trocar as peças do tabuleiro do Tornelo

Se quiser testar, cole no console do browser o codigo deste link. Depois crio a extensão que inverte o tabuleiro também. Até amanhã estará pronto.

@jmlavoier
jmlavoier / JS Questions
Last active October 6, 2020 20:03
Project Assessments
Essa comparação me retorna o que?
`{} === {}`
O que é hoisting? Poderia me explicar o retornaria no console.log?
```js
function MyFunc() {
console.log(x);
let x = 'Front-End Test';
@jmlavoier
jmlavoier / chapter-1.md
Last active November 28, 2019 16:16
functional-programming-in-javascript

page 12

Listing 1.4

in the book

is missed the function

var csv = (student) {
  return `${student.ssn}, ${student.firstname}, ${student.lastname}`;
};
@jmlavoier
jmlavoier / codility-binary-gap.js
Created August 11, 2019 15:05
codility - binary gap
function solution(N) {
// write your code in JavaScript (Node.js 8.9.4)
//100100001001
const binaryValue = N.toString(2);
let start = false;
let count = 0;
let greater = 0;
for (let i in binaryValue) {
$superheroes: c3po, luke, r2d2, anakin;
@each $hero in $superheroes {
.#{$hero} {
background-image : url("#{$hero}.png");
}
}
$breakpoints: (sm: 375px, md: 768px, lg: 1200px);
@each $size, $bp in $breakpoints {
@media only screen and (min-width: $bp) {

Flexbox

Container

display

This defines a flex container; inline or block depending on the given value. It enables a flex context for all its direct children.

.container {
 display: flex; /* or inline-flex */
// formValidations.js
export const validateName = value =>
(value && value[0] === '@') ? true : false;
export const validateSexo = value =>
(value !== '') ? true : false;
export const validateAbout = value =>
(value.length > 50) ? true : false;
<div>
<Field
component={InputField} <!-- component to render -->
type="text" <!-- InputField particular prop -->
name="name" <!-- commom prop for all -->
validate={validateName} <!-- callback function with value -->
value={this.state.name.value} <!-- state value -->
isValid={this.state.name.isValid} <!--state bool isValid -->
onChange={::this.handleChange('name')} <!-- handleChange the state -->
/>
@jmlavoier
jmlavoier / Textarea.js
Created December 22, 2017 22:16
It's a dumb component
// Textarea.js
import React from 'react';
export const TextareaField = ({
value,
name,
style,
onChange,
}) => (
@jmlavoier
jmlavoier / Select.js
Created December 22, 2017 22:14
It's a dumb component
// SelectField.js
import React from 'react';
export const SelectField = ({
value,
name,
type,
options,
style,