This file contains 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
@mixin background-image-retina($file, $type) { | |
$fileName : $file + '.' + $type; | |
$retinaFileName : $file + '@2x.' + $type; | |
$width : image-width($fileName); | |
$height : image-height($fileName); | |
width: $width; | |
height: $height; | |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<style> | |
body { |
This file contains 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
def process_message message | |
# encontra os triggers da conta de que essa mensagem foi inserida | |
# primeira filtragem | |
triggers = find_triggers_for_client message | |
# um dos filtros em batch é chamar o servidor de termos booleano | |
triggers = filter_triggers_in_batch message, triggers | |
triggers = triggers.select do |trigger| | |
# verifica se passa nos ultimos filtros |
This file contains 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
# perceba que agora o metodo está no plural | |
def process_messages messages | |
# vou ter um hash de: client_id: mensagens | |
messages_by_client = messages.group_by do |message| | |
message["client_id"] | |
end | |
messages_by_client.each do |client_id, messages| | |
# como as mensagens estão agrupadas por cliente, preciso pegar apenas os triggers |
This file contains 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
# controller do rails | |
def webhooks_controller data | |
# pusha pra uma fila do redis | |
redis.lpush("webhooks", data.to_json) | |
end | |
# em outro processos | |
def redis_batch_push | |
loop do |
This file contains 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
require "redis_batch_push" | |
require "redis" | |
require_relative "my_sidekiq_worker" | |
queue = "webhooks" | |
redis = Redis.new | |
# numero maximo de escuta por mensagens | |
max_interval_sec = 30 | |
# número máximo de mensagens a enviar de uma vez | |
max_size = 1000 |
This file contains 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, { Component } from 'react'; | |
import Progress from 'components/Progress'; | |
class App extends Component { | |
state = { | |
count: 10 | |
} | |
render() { | |
return <div> |
This file contains 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 from 'react'; | |
export default ({value}) => ( | |
<div> | |
<div style={{ | |
width: `${Math.min(value, 100)}%`, | |
height: 20, | |
background: "red", | |
}}></div> | |
</div> |
This file contains 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, { Component } from 'react'; | |
import Progress from 'components/Progress'; | |
import ProgressInput from 'components/ProgressInput'; | |
class App extends Component { | |
state = { | |
count: 10 | |
} | |
onChangeCount = count => { |
This file contains 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 from 'react'; | |
export default ({value, onChange}) => ( | |
<div> | |
Olá, o progresso é {value} | |
<input type="text" value={value} onChange={(evt) => onChange(evt.target.value)}/> | |
</div> | |
) |
OlderNewer