Skip to content

Instantly share code, notes, and snippets.

###Code Review

É uma técnica onde o desenvolvedor tem seu código revisado por outro desenvolvedor antes de commitar o código.

O commitador deve explicar cada arquivo que está sendo commitado, tanto do ponto de vista técnico quanto de negócio.

Cada trecho de código apontado como alteração pelo "diff" deve ser devidamente explicado ao revisor.

É papel do revisor questionar sobre o código, sugerir melhorias e exigir detalhes sobre a regra de negócio.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript Countdown</title>
</head>
<body>
<span id="days">00</span>
<span id="hours">00</span>
<span id="minutes">00</span>
@airton
airton / sublime-config.txt
Last active May 16, 2018 22:46
Sublime Config
{
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Monokai.tmTheme",
"font_size": 16,
"ignored_packages":
[
"Vintage",
],
"theme": "Boxy Monokai.sublime-theme",
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
import $ from 'jquery';
export const onScrollFixSidebar = function() {
const relatedPosts = $('.related-post')
const body = $('body')
if(relatedPosts.length === 0 || body.width() <= 768) return
const sidebar = $('.sidebar')
const relatedPostsPositionTop = relatedPosts.position().top
function throttle( func, limit ){
var inThrottle;
var lastFunc;
var lastRan;
return function() {
var context = this;
var args = arguments;
if (!inThrottle) {
func.apply(context, args);
// Add tracking on scroll page
var percents = { 0 :true, 25 :true, 50 :true, 75 :true, 100 :true };
var startTrackOnScroll = function(percent) {
if(window.analytics) {
analytics.track('Page Scrolled Percent ' + percent + '%', {
eventLabel: percent
});
}
}
console.log('arrayHashs',arrayHashs)
const array = arrayHashs.reduce((prev, curr) => {
let newJson = [],
json
const hasPercent = curr.Hash.indexOf('%') > -1
console.log(curr.Hash.indexOf('%') > -1)
if( hasPercent ) {
json = decrypt(curr.Hash.split('%')[0])
@airton
airton / Throttling and debouncing in JavaScript.js
Created June 13, 2018 14:36
Throttling and debouncing in JavaScript
const area = document.getElementById("area");
const state = {
throttled: {
x: 0,
y: 0,
},
debounced: {
x: 0,
y: 0,
640px (w) = 100%
220px (h) = ?
640/220 = 2.909
100/2.909 = 34.37%
'use strict';
var SVGSpriter = require('svg-sprite'),
path = require('path'),
mkdirp = require('mkdirp'),
fs = require('fs'),
// config = {
// log: "debug",
// dest: ".",
// mode: {