Skip to content

Instantly share code, notes, and snippets.

View anayarojo's full-sized avatar
💻
Developing

Raul Anaya Rojo anayarojo

💻
Developing
  • Pinnacle Aerospace Inc
  • Hermosillo, Sonora
  • 22:04 (UTC -06:00)
View GitHub Profile
@anayarojo
anayarojo / string.js
Created June 14, 2024 17:31
Utility for strings
export function toPascalCase(str) {
return str
.toLowerCase()
.replace(/[-_]+/g, " ")
.replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => {
return chr.toUpperCase();
});
}
export function toSnakeCase(str) {
@anayarojo
anayarojo / instalaciones-nestjs.md
Created February 26, 2024 21:36 — forked from Klerith/instalaciones-nestjs.md
Instalaciones recomendadas para el curso de Nest.js
@anayarojo
anayarojo / instalaciones.md
Created August 23, 2023 19:42 — forked from Klerith/instalaciones.md
Instalaciones recomendadas - Curso de Angular de cero a experto
@anayarojo
anayarojo / crypto-aes-gcm.js
Created August 23, 2023 04:58 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@anayarojo
anayarojo / Arrays.cs
Created June 14, 2021 05:37
1.1 Get product of all other elements
namespace DailyCodingProblem.CodingProblems
{
public static class Arrays
{
public static int[] GetProductOfAllOtherElements(int[] numbers)
{
// Generate prefix products
var prefixProducts = new int[numbers.Length];
for (int i = 0; i < numbers.Length; i++)

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
@anayarojo
anayarojo / rm_mysql.md
Created September 15, 2020 22:55 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

brew remove mysql

@anayarojo
anayarojo / proposal-for-database.md
Last active September 29, 2020 22:26
Propuestas para la base de datos

Propuesta para base de datos

Normalizar base de datos de acuerdo a los primeros 3 niveles:

Primera formal normal (1NF)

  • Elimine los grupos repetidos de las tablas individuales.
  • Cree una tabla independiente para cada conjunto de datos relacionados.
  • Identifique cada conjunto de datos relacionados con una clave principal.
@anayarojo
anayarojo / vue-structure-proposal.md
Last active December 16, 2020 19:23
Vue structure proposal

Vue structure proposal

components/
        article/
                AppList.vue
        common/
                AppObserver.vue
                NoSSR.vue
        layout/
 AppFooter.vue
@anayarojo
anayarojo / delete-java-commands.md
Last active August 19, 2020 04:46
Comandos para eliminar java en mac

Commands

For delete java

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk(version).jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf ~/Library/Application\ Support/Oracle/Java