Skip to content

Instantly share code, notes, and snippets.

View pramilgawande's full-sized avatar
🎯
Focusing

Pramil Gawande pramilgawande

🎯
Focusing
View GitHub Profile
@deunlee
deunlee / YouTube_Video_ID_By_URL.js
Last active October 20, 2022 12:56
Get YouTube Video ID by URL (+ URL examples)
function getYouTubeVideoIdByUrl(url) {
const reg = /^(https?:)?(\/\/)?((www\.|m\.)?youtube(-nocookie)?\.com\/((watch)?\?(feature=\w*&)?vi?=|embed\/|vi?\/|e\/)|youtu.be\/)([\w\-]{10,20})/i
const match = url.match(reg);
if (match) {
return match[9];
} else {
return null;
}
}
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active May 16, 2024 23:31
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@vkbandi
vkbandi / ExtractEmail.cs
Last active July 6, 2021 19:54
C# code to extract Email from text
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Coderbuddy
{
public class ExtractEmail
{
public List<string> ExtractEmails(string textToScrape)