Skip to content

Instantly share code, notes, and snippets.

View medeirosinacio's full-sized avatar
🤙
Stackoverflow Oriented Programming

Douglas Medeiros medeirosinacio

🤙
Stackoverflow Oriented Programming
View GitHub Profile
@medeirosinacio
medeirosinacio / code revie.md
Last active August 17, 2023 13:22
please code review

image

@medeirosinacio
medeirosinacio / exercício_de_arquitetura_sistema_de_gerenciamento_de_conteúdo_cms.md
Last active February 1, 2023 23:04
Exercício de Arquitetura: Sistema de Gerenciamento de Conteúdo (CMS)

Sistema de Gerenciamento de Conteúdo (CMS)

Exercício de Arquitetura

Objetivo:

Desenhar a arquitetura de software de um sistema de gerenciamento de conteúdo para um website de notícias.

Descrição:

O sistema deve permitir que administradores gerencie as notícias publicadas no website de notícias, processando as imagens das notícias em formato de thumbnail e otimizando-as para exibição. As imagens serão armazenadas em um repositório de arquivos. Além disso, o sistema deve ter uma versão mobile para acesso ao conteúdo através de dispositivos móveis. Não há restrições de componentes ou tecnologias.

Requisitos:

@medeirosinacio
medeirosinacio / array_value_recursive.php
Last active January 23, 2023 13:59
get all values from a multidimensional array, either by key or all.
<?php
if (!function_exists('array_value_recursive')) {
/**
* Retrieves values from a multidimensional array, either by key or all values.
*/
function array_value_recursive(array $arr, ?string $key = null, bool $unique = true): array
{
array_walk_recursive($arr, function ($v, $k) use ($key, &$val) {
if (is_null($key) || ($key && $k == $key)) {
@medeirosinacio
medeirosinacio / example.json
Created January 12, 2023 18:24
example.json
{"name": "guzzlehttp/guzzle", "description": "Guzzle is a PHP HTTP client library", "keywords": [ "framework", "http", "rest", "web service", "curl", "client", "HTTP client", "PSR-7", "PSR-18" ], "license": "MIT", "authors": [ {"name": "Graham Campbell", "email": "hello@gjcampbell.co.uk", "homepage": "https://github.com/GrahamCampbell"}, {"name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling"}, {"name": "Jeremy Lindblom", "email": "jeremeamia@gmail.com", "homepage": "https://github.com/jeremeamia"}, {"name": "George Mponos", "email": "gmponos@gmail.com", "homepage": "https://github.com/gmponos"}, {"name": "Tobias Nyholm", "email": "tobias.nyholm@gmail.com", "homepage": "https://github.com/Nyholm"}, {"name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", "homepage": "https://github.com/sagikazarmark"}, {"name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion"} ], "require": {"php": "^7.2.5 || ^8.0", "ext-json"
@medeirosinacio
medeirosinacio / gitflow.md
Last active January 6, 2023 13:41
Git Flow Diagram in Mermaid
%%{init: { 'logLevel': 'debug', 'gitGraph': {'showCommitLabel': false}} }%%
gitGraph
    commit tag: "release 0.0"
    branch hotfix
    branch develop
    checkout develop
    commit
    branch feature/FIPO-236
 commit
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://example.com.br">
<script type="text/javascript">
window.location.href = "https://example.com.br"
</script>
<title>Page Redirection</title>
</head>
@medeirosinacio
medeirosinacio / get_all_commits_count_from_user.js
Last active August 5, 2021 19:29
Easy way to calculate all commits count from one user
const base_url = 'https://api.github.com';
function httpGet(theUrl, return_headers) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
if (return_headers) {
return xmlHttp
}
return xmlHttp.responseText;

# Loading Gifs for Buttons and Pages


Name View
Loading Bar loading_bar.gif
Loading Bar 2 loading_bar-2.gif
Loading Square loading_square.gif
Loading Spiner spinner.gif
@medeirosinacio
medeirosinacio / class_method_exists.php
Last active June 24, 2021 23:22
Checks if the class has been defined and Checks if the class method exists
/**
* Checks if the class has been defined and Checks if the class method exists
* @param $class_object
* @param $method_name
* @return bool
*/
function class_method_exists($class_object, $method_name)
{
return class_exists($class_object) && method_exists($class_object, $method_name);
}
/**
* Simple multi-bytes ucfirst()
* @param $str
* @return string
*/
function mb_ucfirst_fix($str)
{
return mb_strtoupper(mb_substr($str, 0, 1)) . mb_substr(mb_strtolower($str), 1);
}