Skip to content

Instantly share code, notes, and snippets.

View daviwesley's full-sized avatar
😃
let's code!

Davi Wesley daviwesley

😃
let's code!
  • Netherrealm
View GitHub Profile
@daviwesley
daviwesley / token.sh
Created October 26, 2023 16:34
Get jwt token from cognito url
curl --location 'https://cognito-idp.sa-east-1.amazonaws.com/' \
--header 'X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth' \
--header 'Content-Type: application/x-amz-json-1.1' \
--data-raw '{
"AuthFlow": "USER_PASSWORD_AUTH",
"AuthParameters": {
"PASSWORD": "mysafepassw@rd",
"USERNAME": "username@gmail.com"
},
"ClientId": "3hgver6a6mj336cnbefus3ta1p"
Edit in JSFiddle
Result
HTML
CSS
JavaScript
Resources
<!-- This snippet uses Font Awesome 5 Free as a dependency. You can download it at fontawesome.io! -->
<body>
<div class="container">
import asyncio
import httpx
import time
import csv
start_time = time.time()
async def get_predict(url, params, headers):
# cria uma nova conexão ao invés de usar uma existente como tava antes
import asyncio
import httpx
import time
start_time = time.time()
async def get_pokemon(client, url):
resp = await client.get(url)
REST_FRAMEWORK = {
"PAGE_SIZE": 50,
"COERCE_DECIMAL_TO_STRING": False,
"DEFAULT_PAGINATION_CLASS": "common.paginators.CustomPagination",
"DEFAULT_FILTER_BACKENDS": [
"django_filters.rest_framework.DjangoFilterBackend",
"rest_framework.filters.OrderingFilter",
],
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework_simplejwt.authentication.JWTAuthentication",
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
language_version: python3
- id: trailing-whitespace
- id: debug-statements
language_version: python3
// just copy theses lines to your settings.json file in vscode
{
"python.sortImports.args": [
"--lines=120"
],
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=120",
fetch("https://www.tibia.com/account/ajax_email.php",
{"credentials":"include",
"headers":{"accept":"*/*","accept-language":"pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/x-www-form-urlencoded","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-requested-with":"XMLHttpRequest"},"referrer":"https://www.tibia.com/account/?subtopic=createaccount","referrerPolicy":"no-referrer-when-downgrade","body":"a_EMail=wesley.sud7%40gmail.com","method":"POST","mode":"cors"}).then( e => e.json()).then(e => console.log(e))
data.AjaxObjects[0].Data
"style=background-image:url(https://static.tibia.com/images/global/general/ok.gif);"
// coloca isso no App.vue em methods
createChapter(bookId, data) {
this.$http
.post(`/books/${bookId}/chapters`, { data })
.then(() => this.capitulos.push(data))
.catch(e => console.log("Erro ao criar capitulo", e));
},
editChapter(bookId, chapterId, data) {
api
.put(`/books/${bookId}/chapters/${chapterId}`, { data })
// service
import axios from "axios";
export const api = axios.create({
baseURL: `http://localhost:8080/api`
});
//
import { api } from "../service/";