This file contains hidden or 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 asyncio | |
from typing import Awaitable | |
async def mock_query(n: int) -> str: | |
print(f'chamada: {n}') | |
await asyncio.sleep(n) | |
return f'resultado da api chamada: {n}' | |
async def main() -> None: |
This file contains hidden or 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 nltk | |
from typing import List,Union, Dict, TypedDict, Any | |
nltk.download('punkt') | |
nltk.download('averaged_perceptron_tagger') | |
def is_range_value(sentence: str) -> bool : | |
tokens: List[str] = nltk.word_tokenize(sentence) |
This file contains hidden or 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
sql_string_value <- function(value) { | |
return(ifelse(is.null(value) | is.na(value),"''", paste0("'", gsub("'", "", value), "'"))) | |
} | |
sql_timestamp_value <- function(value) { | |
return(paste0("date(timestamp'", value, "')")) | |
} | |
sql_numeric_value <- function(value) { | |
return(ifelse(is.null(value) | is.na(value), '0', value)) |
This file contains hidden or 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
<script> | |
const configValues = document.cookie.split('; ').find(c => c.startsWith('config')).split('=')[1] | |
const config = JSON.parse(window.unescape(config)) | |
</scrip> |
This file contains hidden or 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
--recursive | |
--reporter spec | |
--file ./test/setup.js | |
--timeout 20000 |
This file contains hidden or 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
const strapi = require('strapi')(); | |
/* | |
* nossa nova função start | |
* não iniciar servidor http | |
* nem printa nada na tela | |
*/ | |
const start = async function(cb) { | |
try { | |
await this.load(); |
This file contains hidden or 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
const strapi = require('strapi')(); | |
before((done) => { | |
strapi.start(() => { | |
done() | |
}); | |
}); | |
after(() => { | |
strapi.stop(0); |
This file contains hidden or 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
const { expect } = require('chai'); | |
describe('strapi.services.link', () => { | |
describe('#create', () => { | |
context('with invalid data', () => { | |
it('should fails', async () => { | |
try { | |
await strapi.services.link.create({ | |
name: "invalid", | |
url: 'invalid-url-formt' |
This file contains hidden or 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
'use strict'; | |
const _ = require('lodash'); | |
module.exports = { | |
fetchAll(params, query) { | |
const { query: request, populate, ...filters } = query; | |
const queryFilter = !_.isEmpty(request) | |
? { |
This file contains hidden or 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
'use strict'; | |
const modelName = 'link'; | |
function isValidUrl(string) { | |
try { | |
new URL(string); | |
} catch (_) { | |
return false; | |
} |
NewerOlder