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 / kill.sql
Created January 24, 2023 11:35
KILL DATABASE PROCESS
SELECT CONTACT('KILL', id, ';') FROM INFORMATION_SCHEMA.PROCESSLIST -- WHERE INFO LIKE '%KEY%';
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>index</h1>
@SilasRodrigues19
SilasRodrigues19 / REFERENCES.md
Last active February 17, 2023 15:29
HTML meta tags cheatsheet
@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'
@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,
<?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 / 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
?>
@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 / 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 / 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 = {