Skip to content

Instantly share code, notes, and snippets.

View shahjugal's full-sized avatar

Jugal Shah shahjugal

View GitHub Profile
@shahjugal
shahjugal / CP_Template.cpp
Created April 10, 2022 02:52
Template for Competitive-Programming by Shah Jugal R.
/**
* @author Shah Jugal R.
* shahjugalr@gmail.com
* GitHub.com/shahjugalr
*
* @brief CodeChef Template v0.0.1
*
*/
#include <bits/stdc++.h>
@shahjugal
shahjugal / DynamicMatrix.cpp
Created April 17, 2022 09:35
2-D Dynamic Matrix in C++
/**
* @file DynamicMatrix.cpp
* @author Jugal Shah (shahjugalr@gmail.com)
* @brief How to allocate a 2-D(True) array dynamically.
* @version 0.1
* @date 17/04/2022
*
* @copyright Copyright (c) 2022
*
*/
@shahjugal
shahjugal / Playlist.sh
Last active August 20, 2022 05:59
Downlaod Youtube playlist with yt-dlp
## HOW TO DOWNLOAD Youtube Videos from playlist on a mac?.
## list.txt file should contain a link of playlist.
## To Get binary visit https://github.com/yt-dlp/yt-dlp on readme see alternatives downlaod mac legacy binary
## Also get binary of ffmepg for conversion.
## Place it in folder in which we need to download video and then just do chmod +x binary_name.
## OR even Better put it in /usr/local/bin.
sudo ./binary_name -a list.txt --no-check-certificate -o "%(playlist_index)s-%(title)s.%(ext)s"
## To Download And Convert it to mp4 use this arguement
@shahjugal
shahjugal / SelectionSort.cpp
Last active July 18, 2022 03:06
Selection Sort.
void sortArray(vector<int>& nums) {
int lastIndex = nums.size() - 1;
// Run for Every Index except last one as it will be sorted anyways.
for (int runningIndex = 0; runningIndex < lastIndex; runningIndex++){
// Find Minimum/Maximum from running index to lastIndex.
int min = runningIndex;
for(int i = runningIndex + 1; i <= lastIndex; i++){
@shahjugal
shahjugal / BubbleSort.cpp
Last active July 18, 2022 04:15
Bubble Sort
void bubbleSort(vector<int>& arr)
{
int lastIndex = arr.size() - 1;
// n-1 passes
for(int i = 0; i < lastIndex; i++){
bool swapped = false;
// from first element to last/secondLast/thirdLast element depending on pass count.
@shahjugal
shahjugal / InsertionSort.cpp
Last active July 18, 2022 10:05
Insertion Sort
void insertionSort(vector<int>& arr){
int lastIndex = arr.size() - 1;
// Repeat from second element to last element.
for(int i = 1; i <= lastIndex; i++){
// Store the current element in a variable.
int element = arr[i];
import 'package:flutter/material.dart';
import 'ColorData.dart';
class AccountMenuItemWidget extends StatelessWidget {
final IconData icon;
final String label;
final VoidCallback? onTap;
AccountMenuItemWidget({
@shahjugal
shahjugal / ipnotify.py
Created September 29, 2023 11:21
Send my new Static IP Address to me whenever changes
## Add it in task scheduler. as python as binary and arguemeent as location of this script.
import requests
import smtplib
import os
from plyer import notification
# Email configuration
smtp_server = 'smtp-mail.outlook.com' # SMTP server address
smtp_port = 587 # SMTP server port