Skip to content

Instantly share code, notes, and snippets.

View luisenriquecorona's full-sized avatar
😎
I may be slow to respond.

TextKi JS luisenriquecorona

😎
I may be slow to respond.
View GitHub Profile
/******************************************************
Find and retrieve the encryption key automatically
Note: This is a draft version, please help to modify, Thanks!
******************************************************/
function keyFinder (str) { // str is used to get the input of encrypted string
const wordBank = [
'I ',
'You ',
'We ',
'They ',
@luisenriquecorona
luisenriquecorona / index.html
Created August 16, 2021 05:47
LFU Cache.js
class DoubleLinkedListNode {
// Double Linked List Node built specifically for LFU Cache
constructor (key, val) {
this.key = key
this.val = val
this.freq = 0
this.next = null
this.prev = null
}
}
@luisenriquecorona
luisenriquecorona / script.js
Created August 15, 2021 06:40
SudokuBoard.js
class Sudoku {
// Sudoku Class to hold the board and related functions
constructor (board) {
this.board = board
}
findEmptyCell () {
// Find a empty cell in the board (returns [-1, -1] if all cells are filled)
for (let i = 0; i < 9; i++) {
for (let j = 0; j < 9; j++) {
function Temperature(degrees) {
this.degrees = degrees;
}
Temperature.prototype[Symbol.toPrimitive] = function(hint) {
switch (hint) {
case "string":
return this.degrees + "\u00b0"; // degrees symbol
case "number":
return this.degrees;
@luisenriquecorona
luisenriquecorona / npm.txt
Last active July 4, 2021 04:32
NPM HTML5 boilerplate
mkdir html5-boilerplate
unzip html5-boilerplate*.zip -d html5-boilerplate
npx create-html5-boilerplate new-site
cd new-site
npm install
npm start