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
// "start": "webpack --config webpack.dev.js --watch" | |
const path = require('path'); | |
module.exports = { | |
mode: 'development', | |
entry: { | |
i18n: ['./libs/i18n/src/index.ts'], | |
components: ['./libs/components/src/index.tsx'], | |
cx: ['./apps/cx/src/index.tsx'], |
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, { FC, ReactNode } from "react"; | |
interface ICardProps { | |
chindren: ReactNode; | |
} | |
type CardProps<P> = FC<P> & { | |
Header: ReactNode; | |
}; |
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 API = { | |
headers: new Headers(), | |
init(appId, appRestKey) { | |
API.headers.append('X-Parse-Application-Id', appId); | |
API.headers.append('X-Parse-REST-API-Key', appRestKey); | |
}, | |
events: { | |
get: ()=> { | |
return fetch('https://parseapi.back4app.com/classes/events?', { | |
method: 'GET', |
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 numeral from 'numeral'; | |
export default currency = (function() { | |
const CURRENCIES = { BRL: 'R$' }; | |
numeral.register('locale', 'pt-br', { | |
delimiters: { | |
thousands: '.', | |
decimal: ',' | |
}, | |
abbreviations: { |
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
// HTML | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Redux</title> | |
</head> | |
<body> |
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
async function asyncConnectToSocket() { | |
let { Receiver, Emmiter } = await SktServer.init({ httpServer }); | |
Receiver | |
.subscribe('message', data => { | |
console.log(data); | |
}); | |
Emmiter | |
.emmit('my message'); | |
}; |
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
#!/usr/bin/env node | |
const http = require('http'); | |
const SktServer = require('./index').SktServer; | |
var httpServer = http.createServer((request, response) => { | |
console.log((new Date()) + ' Received request for ' + request.url); | |
response.writeHead(404); | |
response.end(); | |
}); |
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
var SIZE = 40, | |
count = 0, | |
result = '', | |
rec; | |
(rec = () => { | |
var unfilledSide = ((SIZE - count) / 2) | 0; | |
result += | |
Array(unfilledSide).join(' ') + | |
Array(count).join('*') + |
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
var myself = { firstname: 'André ', lastname:'Pesci Cazetto' }; | |
function showFullName(textparam = 'Text Param', numberparam = 10) { | |
console.log(this.firstname, this.lastname, textparam, numberparam); | |
} | |
showFullName.call(myself); | |
showFullName.apply(myself); | |
// Call passa os parâmetros na sequência |