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
// Delay duration in milliseconds | |
const delayDuration = 1000; | |
// Function to parse credits from the text | |
function parseCredits() { | |
const creditsElement = document.querySelector('.t-14.t-black--light .t-bold'); | |
if (creditsElement) { | |
const creditsText = creditsElement.textContent.trim(); // "10/250" | |
const [availableCredits, totalCredits] = creditsText.split('/').map(Number); // Parse the numbers | |
console.log(`Credits available: ${availableCredits}/${totalCredits}`); |
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
@echo off | |
setlocal | |
REM Set the path to the Downloads folder | |
set "download_folder=C:\Users\[UserName]\Downloads" | |
echo Target folder is: %download_folder% | |
REM Check if the downloads directory exists | |
if not exist "%download_folder%" ( | |
echo The specified folder does not exist please input your username: %download_folder% |
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 React from 'react'; | |
interface Props { | |
title: string; | |
description: string; | |
} | |
const ReusableComponent: React.FC<Props> = ({ title, description }) => { | |
return ( | |
<div className="relative min-h-screen flex"> |
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
// MyComponent.js | |
import React from 'react'; | |
// Define a functional component that takes a prop called "name" | |
function MyComponent({ name }) { | |
// Return a div with an h1 that displays a greeting using the "name" prop | |
return ( | |
<div> | |
<h1>Hello, {name}!</h1> |
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 necessary modules | |
from typing import List, Optional | |
import pytest | |
# Define a function that finds the maximum value in a list of integers | |
def find_max(numbers: List[int]) -> Optional[int]: | |
if not numbers: | |
return None | |
else: | |
return max(numbers) |
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
/** | |
* @param {number} x | |
* @return {number} | |
*/ | |
var reverse = (x) => { | |
if (x < 0) { | |
return -1 * reverse(-x) | |
} | |
const solution = (x + "").split('').reverse().join(''); | |
return (solution > 2 ** 31 - 1) ? 0 : solution; |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
XButton2 & Tab::AltTab | |
return | |
Numpad5:: | |
Send, git add . {Enter} git commit -m "AutoCommit" {Enter}git push {Enter} |
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
/** | |
* @param {number[]} nums | |
* @return {number} | |
*/ | |
var removeDuplicates = function(nums) { | |
nums.forEach((num,i) => { | |
if(nums[i+1] !== null && nums[i+1] == nums[i] ){ | |
nums.splice(i, 1); | |
console.log(nums) | |
removeDuplicates(nums) |
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
/** | |
* @param {number[]} nums | |
* @return {number[]} | |
*/ | |
var runningSum = function(nums) { | |
let newNums = []; | |
let numsSum = 0; | |
nums.forEach((num,i) =>{ | |
if(nums[i] !== null){ |
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
// /** | |
// * @param {string} s | |
// * @return {boolean} | |
// */ | |
let brackets = { | |
"(": ")", | |
"[": "]", | |
"{": "}", | |
}; |
NewerOlder