Skip to content

Instantly share code, notes, and snippets.

Breno Calazans klzns

Block or report user

Report or block klzns

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@klzns
klzns / README.md
Last active Jul 23, 2019
Managing two render majors of an app
View README.md

Contributing

In this document, we'll describe how we are dealing with the development of two major versions.

This document example have two branches:

  • master: major 0 of the app with render 7
  • 1.x: major 1 of the app with render 8

Development

View fade.js
<div className="w-100 absolute bottom-0"
style={{
background: 'linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)',
maxHeight: '50px',
height: '100%',
pointerEvents: 'none',
}}>
@klzns
klzns / example.html
Created Jul 11, 2018
React dentro de AngularJS
View example.html
<react component="vtex.Hello" props=something.insideAngularScope"></react>
@klzns
klzns / picture-in-picture.js
Last active Jul 2, 2018
Adicione esse script para abrir a transmissão da copa em picture in picture no Safari.
View picture-in-picture.js
(function () {
var video = document.querySelector('video:not([title="Advertisement"])')
if (!video.webkitSupportsPresentationMode || typeof video.webkitSetPresentationMode !== 'function') {
console.error('Esse código só funciona no Safari!')
return
}
var scoreX = document.querySelector('.placar__equipes')
var button = document.createElement('button')
@klzns
klzns / javascript.json
Created Oct 5, 2017
React Component Snippet
View javascript.json
{
"React Component": {
"prefix": "reactComp",
"body": [
"import React, { Component } from 'react'",
"import PropTypes from 'prop-types'",
"",
"class ${1:${TM_FILENAME/(.*)\\.js/${1:/capitalize}/}} extends Component {",
" render() {",
" return (",
@klzns
klzns / index.js
Created Aug 15, 2017
How to add hot module replacement (react-hot-loader) in Create React App
View index.js
import { AppContainer } from 'react-hot-loader' // Install `npm install react-hot-loader@next`
import React from 'react'
import App from './App'
const renderApp = (Root) => {
React.render(
<AppContainer>
<Root />
</AppContainer>,
document.getElementById('app-root')
@klzns
klzns / Links.md
Last active Apr 26, 2018
Links para aprender Javascript e React
View Links.md
View keybase.md

Keybase proof

I hereby claim:

  • I am brenoc on github.
  • I am brenoc (https://keybase.io/brenoc) on keybase.
  • I have a public key whose fingerprint is AE0E 5CD3 D144 983C 2FF8 8C31 B6BC FD1C 4D98 43DD

To claim this, I am signing this object:

@klzns
klzns / transformToActionNames.js
Created Aug 15, 2016
Transform camelCase to ACTION_NAMES
View transformToActionNames.js
function transformToActionNames(actions) {
return _.map(actions, (action) => {
let newActionName = ''
for (var index = 0; index < action.length; index++) {
var char = action[index]
if (index === 0) {
newActionName += char.toUpperCase()
continue
}
if (char == char.toUpperCase()) {
@klzns
klzns / iFramePayment.js
Created Aug 15, 2016
Fechamento de compra com iFrame
View iFramePayment.js
function handleEvents(event) {
switch(event) {
// ...
case 'sendPayments.vtex':
let checkoutPayments = event.data.arguments[0];
let transactionResponse = event.data.arguments[1];
let deviceFingerprint = event.data.arguments[2];
sendPayments(checkoutPayments, transactionResponse, deviceFingerprint);
break;
}
You can’t perform that action at this time.