This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isValidDeepLink(url) { | |
const regex = /^[a-zA-Z0-9_-]+:\/\/([a-zA-Z0-9\/]+)(\?([a-zA-Z0-9=&]+))?$/; | |
return regex.test(url); | |
} | |
function isValidDeepLink(url) { | |
const regex = /^[a-zA-Z0-9_-]+:\/\/([a-zA-Z0-9\/$(){}_\-.\[\]]+)(\?([a-zA-Z0-9=&$(){}_\-.\[\]]+))?$/; | |
return regex.test(url); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('body > tp-yt-iron-overlay-backdrop').remove(); | |
document.querySelector('body > ytd-app > ytd-popup-container').remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceSlashesWithDashes(path) { | |
// Remove the leading and trailing slashes if they exist | |
const trimmedPath = path.replace(/^\/|\/$/g, ''); | |
// Replace all remaining slashes with dashes | |
return trimmedPath.replace(/\//g, '-'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import\s+(\w+)\s+from\s+'kepler\/lib\/components\/(?!\\1';)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sortTableByColumn(tableId, columnIdx) { | |
const table = document.getElementById(tableId); | |
const tbody = table.querySelector('tbody'); | |
const rows = Array.from(tbody.getElementsByTagName('tr')); | |
rows.sort((rowA, rowB) => { | |
const cellA = rowA.getElementsByTagName('td')[columnIdx]; | |
const cellB = rowB.getElementsByTagName('td')[columnIdx]; | |
// Handle empty cells |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to count lines of code in a file | |
count_lines_of_code() { | |
local file=$1 | |
local lines=$(wc -l < "$file") | |
echo "$lines" | |
} | |
# Function to sort files based on lines of code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hacer stash de todos los archivos, nuevos o modificados | |
git stash save --include-untracked "nombre del stash" | |
# Hacer stash de todos los archivos, nuevos o modificados MAS corto | |
git stash -u | |
# Retomar los cambios del ultimo stash guardado | |
git stash pop | |
# Hacer un hard reset de una branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Map function to iterate over questions and add the `asertion` any */ | |
function mapAgeGenderQuestionsAddAny(question) { | |
question.assertion = "any"; | |
return question; | |
} | |
/* Reducer function to alter the props of the age_and_gender{_2} pages */ | |
function reducerAgeAndGenderQuestion(questionProps) { | |
var tooltipValue = "You’ll miss out on certain plan types if you don’t submit your birth date and gender! If you only want to see Medicare Advantage, you can hit “Continue” to skip this question."; | |
var questions = questionProps.questions.map(mapAgeGenderQuestionsAddAny); | |
questionProps.tooltipHeadline = tooltipValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function startTimer(duration) { | |
var timer = duration, minutes, seconds; | |
var intervalId = setInterval(function () { | |
minutes = parseInt(timer / 60, 10); | |
seconds = parseInt(timer % 60, 10); | |
minutes = minutes < 10 ? "0" + minutes : minutes; | |
seconds = seconds < 10 ? "0" + seconds : seconds; | |
console.log(minutes + ":" + seconds); |
NewerOlder