Skip to content

Instantly share code, notes, and snippets.

View yazdipour's full-sized avatar
:shipit:
Noob

Shahriar yazdipour

:shipit:
Noob
View GitHub Profile
# This PowerShell script will prevent your computer from going to sleep by randomly moving the mouse and pressing the Shift key.
# Just run it and enjoy your remote working time at home!
$idleTimeThreshold = 60 # Idle time threshold in seconds
$sleepTime = $idleTimeThreshold / 10 # Sleep time as 1/10th of idle time threshold
if (-not ([System.Management.Automation.PSTypeName]'DoNotSleep').Type) {
Add-Type @"
using System;
using System.Runtime.InteropServices;
@yazdipour
yazdipour / UTM.java
Last active September 15, 2023 12:40
UTM, WGS84 Converter
import java.util.Locale;
/**
* Class representing UTM-coordinates. Based on code from stack overflow.
* @see <a href="https://stackoverflow.com/questions/176137/java-convert-lat-lon-to-utm">Stack Overflow</a>
* @see <a href="https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system">Wikipedia-entry on UTM</a>
* @author Rolf Rander
*/
public class UTM
{
import pyautogui
import time
for i in range(20):
pyautogui.click(1888, 1000)
time.sleep(5)
print(i)
function deleteAll() {
$('button[data-cy="Delete"]').each(
function (index, element) {
console.log(index);
$(element).click().delay(200);
$('button[data-cy="delete-confirm"]').click().delay(200);
}
);
}
// Each time you can delete 26 articles in ListView, 21 in GridView.
@yazdipour
yazdipour / watchlater-keyword.js
Created July 14, 2022 22:30
Collected Youtube watchlater based on keyword
var urls = {};
$('ytd-playlist-video-renderer').each(function (index, value) {
var keywords = ["uwp", 'xaml', "xamarin", 'quantum', 'android', 'css', 'tax', 'unity', 'game', 'asp', 'linq', 'graphql', 'c#', 'python', 'canada', 'windows', 'dell'];
var hyperlink = $(value).find('a.ytd-playlist-video-renderer')[0];
var videoTitle = hyperlink.innerText.toLowerCase();
// for all keywords in the array
for (var i = 0; i < keywords.length; i++) {
// if the keyword is in the title
if (videoTitle.includes(keywords[i])) {
// urls.push(hyperlink.href);
@yazdipour
yazdipour / bleu.ipynb
Created February 1, 2022 00:36
bleu.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Universities  Times Higher Education Ranking (2021)  Shanghai Jiao Tong University Ranking (2020)  TopUniversities Ranking (2021)  U.S. News & World Report Ranking (2021) 
Harvard University 3 1 3 1
Massachusetts Institute of Technology (MIT) 5 4 1 2
Stanford University 2 2 2 3
University of California, Berkeley 7 5 30 4
Columbia University 17 7 19 6
California Institute of Technology - Caltech 4 8 4 7
University of Washington 29 16 72 8
Johns Hopkins University 12 15 25 10
Yale University 8 11 17 11
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"existingStorageAccountResourceGroupName": {
"type": "string",
"metadata": {
"description": "Resource group for existing storage account"
}
},