Skip to content

Instantly share code, notes, and snippets.

View TechWithTy's full-sized avatar
🎯
Focusing

TechWIthTy TechWithTy

🎯
Focusing
View GitHub Profile
@TechWithTy
TechWithTy / AutoDownloadDelete.bat
Last active November 23, 2023 17:47
Delete All Files In Downloads Folder After A week
@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%
@TechWithTy
TechWithTy / login.tsx
Created June 16, 2023 02:10
Customer Portal Example Tailwind.css
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">
@TechWithTy
TechWithTy / App.js
Created March 18, 2023 15:59
React: Demonstrating - Continuous Integration | Continuous Delivery | Continuous Deployment | Big O | Unit Testing | Type Checking
// 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>
@TechWithTy
TechWithTy / __main__.py
Created March 18, 2023 15:52
PYTHON: Demonstrating - Continuous Integration | Continuous Delivery | Continuous Deployment | Big O | Unit Testing | Type Checking
# 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)
/**
* @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;
#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}
@TechWithTy
TechWithTy / removeDuplicates.js
Created October 30, 2020 21:49
Remove duplicates from array javscript
/**
* @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)
@TechWithTy
TechWithTy / runningSum.js
Created October 30, 2020 20:17
Running sum O(n) Leetcode
/**
* @param {number[]} nums
* @return {number[]}
*/
var runningSum = function(nums) {
let newNums = [];
let numsSum = 0;
nums.forEach((num,i) =>{
if(nums[i] !== null){
@TechWithTy
TechWithTy / ValidParn.js
Created October 27, 2020 01:45
Valid Parenthesis LeetCode Algorithim
// /**
// * @param {string} s
// * @return {boolean}
// */
let brackets = {
"(": ")",
"[": "]",
"{": "}",
};
@TechWithTy
TechWithTy / mergeLinkedLists.js
Created October 27, 2020 00:55
Merge Two sorted Linked lists
let mergeTwoLists = function (l1, l2) {
let dummy = new ListNode(-1);
let head = dummy;
while (l1 !== null && l2 !== null) {
if (l1.val <= l2.val) {
dummy.next = l1;
l1 = l1.next;
} else {
dummy.next = l2;