Skip to content

Instantly share code, notes, and snippets.

View SilasRodrigues19's full-sized avatar
🐒
Attempting to define the undefined in both code and reality

Silas Rodrigues SilasRodrigues19

🐒
Attempting to define the undefined in both code and reality
View GitHub Profile
@SilasRodrigues19
SilasRodrigues19 / README.md
Last active January 20, 2024 07:42
Invert the favicon color according to the browser theme, to prevent the white logo from being applied to a white background or the black logo from being applied to a black background
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  <path fill="#000"
    d="m21.484 7.125l-9.022-5a1.003 1.003 0 0 0-.968 0l-8.978 4.96a1 1 0 0 0-.003 1.748l9.022 5.04a.995.995 0 0 0 .973.001l8.978-5a1 1 0 0 0-.002-1.749" />
  <path fill="currentColor"
    d="m12 15.856l-8.515-4.73l-.971 1.748l9 5a1 1 0 0 0 .971 0l9-5l-.971-1.748z" />
  <path fill="currentColor"
    d="m12 19.856l-8.515-4.73l-.971 1.748l9 5a1 1 0 0 0 .971 0l9-5l-.971-1.748z" />

 
@SilasRodrigues19
SilasRodrigues19 / README-TRANSLATE.md
Last active December 2, 2023 18:14
Workflow para traduzir README.md em inglês e criar uma versão em do mesmo arquivo em Português README.pt.md
@SilasRodrigues19
SilasRodrigues19 / projects.md
Created April 22, 2023 16:14
Meus projetos que são fáceis de contribuir, projetos da comunidade.
@SilasRodrigues19
SilasRodrigues19 / script.js
Created April 1, 2023 23:51
js/script.js
let canvas = document.getElementById('snake');
let context = canvas.getContext('2d');
let box = 32;
let snake = [];
snake[0] = {
x: 8 * box,
y: 8 * box,
};
let direction = 'right';
let food = {
@SilasRodrigues19
SilasRodrigues19 / PHPMailer.php
Created March 26, 2023 00:57
PHPMailer host and ports
// Microsoft Office 365
$mail->Host = 'smtp.office365.com';
// Yahoo Mail
$mail->Host = 'smtp.mail.yahoo.com';
// iCloud
$mail->Host = 'smtp.mail.me.com';
// Amazon SES
@SilasRodrigues19
SilasRodrigues19 / INSTRUÇÕES.md
Created March 22, 2023 01:18
Calendário PHP (Renomeia a pasta pra esse nome e joga os 3 arquivos dentro)

Instruções para rodar e testar usando o XAMPP

  1. Baixe e instale o XAMPP em seu computador a partir do site oficial: https://www.apachefriends.org/index.html
  2. Abra o executável xampp-control.exe, geralmente localizado em C:\xampp e inicie o Apache, conforme imagem: https://i.imgur.com/hxnlovN.png
  3. Mova a pasta do projeto pra dentro de htdocs, geralmente localizado em C:\xampp\htdocs
  4. Abra o navegador e digite o endereço localhost na barra de endereço para verificar se o XAMPP está funcionando corretamente.
  5. Abra o navegador e digite o endereço localhost/nome_da_sua_pasta na barra de endereço para acessar seu projeto, nesse caso é localhost/Calend%c3%a1rio%20PHP/
@SilasRodrigues19
SilasRodrigues19 / autoload.php
Created March 21, 2023 15:56
Exemplo de validação de informação no banco, antes de cadastrar
<?php
$autoload['helper'] = array('url', 'html', 'file', 'basic'); // basic nome do helper que eu criei pra exibir mensagem de erro
?>
<?php
date_default_timezone_set('America/Sao_Paulo');
$currentDate = new DateTime();
$currentHour = $currentDate->format('H');
$currentMinutes = $currentDate->format('i');
if ($currentHour >= 5 && $currentHour < 12) {
$message = "tenha um bom dia";
@SilasRodrigues19
SilasRodrigues19 / script.ts
Last active March 15, 2023 15:34
/src/ts/script.ts
interface TranslationKeys {
home: string;
about: string;
services: string;
portfolio: string;
contact: string;
}
type Translations = {
pt: TranslationKeys,
@SilasRodrigues19
SilasRodrigues19 / script.js
Last active March 15, 2023 16:09
/src/ts/script.js
// Toggle Menu //
const styleSwitcher = document.querySelector(".style-switcher");
const links = document.querySelectorAll('.aside-link');
let menutoggle = document.querySelector('.toggle');
let aside = document.querySelector('.aside');
let skinColor = '#ec1839'
window.addEventListener('resize', () => {
if (window.screen.width >= 1001 && menutoggle && aside && aside instanceof HTMLElement) {
aside.style.left = '0'