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 PropTypes from "prop-types" | |
import Home from "./Home" | |
const fakeDatabase = { | |
"Heisenberg": [ | |
"8am - Chemistry classes at school", | |
"12:30pm - Meet Jesse for lunch", | |
"15pm - Meet Gus at the Pollos Hermanos", | |
"20pm - Dinner by the pool with Hank and Marie" |
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'; | |
import PropTypes from "prop-types" | |
const Home = ({ username, tasks }) => ( | |
<div> | |
<p>Welcome, {username}!</p> | |
<ul> | |
{tasks && tasks.map((t, idx) => <li key={idx}>{t}</li>)} | |
</ul> | |
</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'; | |
import App from './App'; | |
import { mount } from 'enzyme'; | |
import toJson from "enzyme-to-json" | |
it("should render the homepage for the non logged in user", () => { | |
const props = { | |
isLoggedIn: false, | |
username: null | |
} |
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'; | |
import App from './App'; | |
import { mount } from 'enzyme'; | |
import toJson from "enzyme-to-json" | |
import Home from './Home'; | |
it("should render the homepage for the non logged in user", () => { | |
const props = { | |
isLoggedIn: false, | |
username: null |
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
class ReportEngine(BaseModel, models.Model): | |
id = HashedAutoField(primary_key=True) | |
name = models.CharField(max_length=250) | |
type = models.CharField( | |
choices=(("metabase", "Metabase"),), default="metabase", max_length=50 | |
) | |
base_url = models.URLField() | |
integration_api_key = models.CharField(max_length=250) | |
class EmbeddedReport(BaseModel, models.Model): |
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
class EmbeddedReportResource(PaginatorMixin, APIResource): | |
preparer = EMBEDDED_REPORT_LIST_PREPARER | |
paginate = True | |
page_size = 40 | |
@property | |
def base_query(self): | |
return ( | |
EmbeddedReport.objects.filter(active=True) | |
.select_related("engine") |
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
# Escolha sua branch de origem, de onde os commits serão revertidos | |
git checkout main | |
# Usando o git log, encontre o hash do commit do ponto que você deseja retornar para. | |
git checkout f21306c | |
# Agora vamos fazer uma comparação entre a posição atual do histórico e a main. | |
# Nesse ponto precisamos confirmar se as mudanças exibidas aqui estão corretas ;) | |
# Se não estiverem, você provavelmente está no ponto errado do histórico (veja o git log) | |
git diff main |
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
# Escolha sua branch de origem, de onde os commits serão revertidos | |
git checkout main | |
# Use o commando git revert com a opção "-n" pra gerar um único commit | |
# Os ids abaixo podem ser encontrados usando o `git log` | |
git revert -n f21306c..e330c04 # OLD_COMMIT..RECENT_COMMIT | |
# Nesse ponto, você já pode usar os comandos de status e diff pra conferir se a alteração está correta: | |
git status # mostra os nomes dos arquivos alterados | |
git diff # mostra as mudanças efetivas |
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 lorem | |
from locust import HttpUser, task, between | |
class WebsiteUser(HttpUser): | |
wait_time = between(1, 3) | |
@task(5) | |
def index(self): | |
self.client.get("/tasks/") |
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
class EmbeddedReport(BaseModel, models.Model): | |
... | |
... | |
... | |
def get_report_url_for_business(self, business) | |
map_resource = { | |
"dashboard": { | |
"params": {"dashboard": int(self.reference_id)}, | |
"url_path": "dashboard", | |
}, |
OlderNewer