Skip to content

Instantly share code, notes, and snippets.

View cazetto's full-sized avatar
🎯
Focusing

André Pesci Cazetto cazetto

🎯
Focusing
View GitHub Profile
// "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'],
import React, { FC, ReactNode } from "react";
interface ICardProps {
chindren: ReactNode;
}
type CardProps<P> = FC<P> & {
Header: ReactNode;
};
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',
import numeral from 'numeral';
export default currency = (function() {
const CURRENCIES = { BRL: 'R$' };
numeral.register('locale', 'pt-br', {
delimiters: {
thousands: '.',
decimal: ','
},
abbreviations: {
import React, { Component } from 'react';
import { View, Text, } from 'react-native';
import { SideMenu } from 'react-native-elements';
import Menu from './Menu';
export default SideMenuHOC = Composed =>
class SideMenuComposed extends Component {
constructor(props) {
// 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>
async function asyncConnectToSocket() {
let { Receiver, Emmiter } = await SktServer.init({ httpServer });
Receiver
.subscribe('message', data => {
console.log(data);
});
Emmiter
.emmit('my message');
};
#!/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();
});
var SIZE = 40,
count = 0,
result = '',
rec;
(rec = () => {
var unfilledSide = ((SIZE - count) / 2) | 0;
result +=
Array(unfilledSide).join(' ') +
Array(count).join('*') +
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