Skip to content

Instantly share code, notes, and snippets.

View simaodeveloper's full-sized avatar
🧑‍💼
Focused!

Daniel Simão simaodeveloper

🧑‍💼
Focused!
View GitHub Profile
pex.add({
name: 'Accordion',
init: (_elements, options) => {
const elements = Array.from(_elements);
// tools
const isTitle = target => target.classList.contains('accordion__title');
const isOpen = target => target.classList.contains('accordion--open');
# Front-end
npm i -D jest husky lint-staged standard rollup babel-jest @babel/core @babel/preset-env @commitlint/config-conventional @commitlint/cli
# babel.config.js
```
module.exports = {
presets: [
[
'@babel/preset-env'
],
@simaodeveloper
simaodeveloper / whichtype.js
Created July 3, 2020 19:12
A tiny library to help test the type of a value
const firstLetterUpperCase = str =>
str.replace(/(^\w)/, m => m.toUpperCase());
const firstLetterLowerCase = str =>
str.replace(/(^\w)/, m => m.toLowerCase());
const toString = value =>
Object.prototype.toString.call(value);
const isType = (type, value) =>
const { fromEvent } = Rx;
const { map, pluck } = RxOperators;
const input = document.createElement('input');
const container = document.querySelector('.container');
container.appendChild(input)
const observable = fromEvent(input, 'input')
.pipe(
//map(event => event.target.value),
@simaodeveloper
simaodeveloper / tddtalks.json
Last active December 8, 2020 02:34
Learning About Front-End Unit Test
{
"talks": [
{
"title": "Unit Testing Front-end Code",
"url": "https://www.youtube.com/watch?v=VSXGu73MiPg",
"author": "Michael Jasper"
},
{
"title": "Testing Front-end Code the Right Way",
"url": "https://www.youtube.com/watch?v=zF1hlOxucHE",
@simaodeveloper
simaodeveloper / style.js
Created July 12, 2019 17:44
References to build a CSS-in-JS stylesheet
/*
https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList
https://developer.mozilla.org/en-US/docs/Web/API/CSSRule
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet
https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
*/
```javascript
style`
display: flex;

My Tips to Learning React with Redux

How to use React with Redux

We need to use a react-redux package to accomplish this connection between Redux and React. The ReactRedux provides a small API with two key features: Provider and connect. The Provider is a wrapper component from ReactRedux that wraps your React app. This wrapper then allows you to access the Redux store and dispatch function throughout your component tree. Provider takes two props, the Redux store and the child components of your app.

#1 Motivação: https://www.python.pro.br/aperitivo/video/motivacao
#2 Instalando o Python:
* Mac (OSX): https://www.python.pro.br/aperitivo/video/instalacao-mac
* Windows: https://www.python.pro.br/aperitivo/video/instalacao-windows
* Linux (Ubuntu): https://www.python.pro.br/aperitivo/video/instalacao-ubuntu
#3 IDE Pycharm: https://www.python.pro.br/aperitivo/video/pycharm
#4 Tipo inteiro: https://www.python.pro.br/aperitivo/video/inteiro
@simaodeveloper
simaodeveloper / learn-oop.md
Last active November 12, 2018 02:18
Learn OOP

Learn OOP

What's a OOP?

OOP (Oriented Object Programming) is a style of programming that's focus in objects instead of functions.

Four Pillars of OOP

Encapsulation (Encapsulamento)