Skip to content

Instantly share code, notes, and snippets.

View ThorondorManwe's full-sized avatar
🤖
Focusing

Carlos Rangel ThorondorManwe

🤖
Focusing
View GitHub Profile
<?php
// Connect to the MySQL database.
$dsn = "mysql:host=localhost;port=3306;dbname=myapp;user=root;charset=utf8mb4";
// Tip: This should be wrapped in a try-catch. We'll learn how, soon.
$pdo = new PDO($dsn);
$statement = $pdo->prepare("select * from posts where id = 1");
$statement->execute();
@JeffreyWay
JeffreyWay / homework-solution.php
Created September 29, 2022 17:36
PHP for Beginners, Episode 9 - Lambdas and Flexibility
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$books = [
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<?php
$movies = [
@JeffreyWay
JeffreyWay / homework-solution.php
Last active August 4, 2023 20:42
PHP For Beginners, Episode 5 - Conditionals and Booleans
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>
<?= 'Hello World' ?>
</h1>
@Klerith
Klerith / templateSlice.js
Last active April 25, 2024 17:38
Cascaron para crear Redux Slices rápidamente
import { createSlice } from '@reduxjs/toolkit';
export const templateSlice = createSlice({
name: 'name',
initialState: {
counter: 10
},
reducers: {
increment: (state, /* action */ ) => {
//! https://react-redux.js.org/tutorials/quick-start
@Klerith
Klerith / vite-testing-config.md
Last active May 22, 2024 19:08
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:

Firebase Setup For House Marketplace

  1. Create Firebase Project
  2. Create "web" app within firebase to get config values"
  3. Install firebase in your project "npm i firebase
  4. Create a config file in your project
  5. Add authentication for email/password and Google
  6. Create a user from Firebase
  7. Enable Firestore
  8. Add rules for firestore
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="https://fonts.googleapis.com/css2?family=Raleway" rel="stylesheet">
<link rel="stylesheet" href="../static/css/styles.css">
</head>
<body>
<div class="wrapper">
@Klerith
Klerith / Instalaciones-React.md
Last active May 11, 2024 22:25
Instalaciones recomendadas para mi curso de React de cero a experto
@Klerith
Klerith / heroes-with-desc.js
Last active April 24, 2024 19:55
Una colección de Super Héroes
export const heroes = [
{
'id': 'dc-batman',
'superhero':'Batman',
'publisher':'DC Comics',
'alter_ego':'Bruce Wayne',
'first_appearance':'Detective Comics #27',
'characters':'Bruce Wayne'
},
{