Skip to content

Instantly share code, notes, and snippets.

@ProjectEli
ProjectEli / TW_down_HK.py
Created October 9, 2023 04:01
TW_Eta_Rank_Analyzer
import urllib.request, datetime, os
# This code executes many http get requests in short time
# So don't abuse it
NumPages = 20
startTime = datetime.datetime.now()
if startTime.hour < 11:
dirName = (startTime - datetime.timedelta(days=1)).strftime('%Y%m%d')
else:
@ProjectEli
ProjectEli / googleScholar2JSON.js
Created August 11, 2024 02:18
Google scholar extract as json
const tableBody = document.getElementById('gsc_a_b');
const rows= tableBody.querySelectorAll('tr');
const rowdata = [];
rows.forEach(row => {
const cells = row.querySelectorAll('td');
const title = cells[0].querySelector('a').textContent;
const authors = cells[0].querySelector('.gs_gray').textContent.trim();
const journal = cells[0].querySelectorAll('.gs_gray')[1].textContent.trim();
const citations = cells[1].querySelector('a').textContent;
const year = cells[2].textContent;
#Requires AutoHotkey v2.0
; what's modified in v2 ref: https://blog.naver.com/550sn/223304085896
; #NoEnv ; performance enhancement but default in ahk v2
; #Warn ; Enable warnings to assist with detecting common errors.
; SendMode Input ; Recommended for new scripts due to its superior speed and reliability but default in ahk v2
SetWorkingDir A_ScriptDir ; Ensures a consistent starting directory. A_ScriptDir is built-in variable in ahk v2
^Numpad1:: Run "Notepad"
^Numpad2:: Run "mspaint"
^Numpad3:: Run "shell:appsfolder\Microsoft.Whiteboard_8wekyb3d8bbwe!Whiteboard"
@ProjectEli
ProjectEli / pyTabManagerSaver.py
Created December 29, 2024 00:30
Save opened tabs for potential reboot in windows
import psutil
import csv
import datetime, time, locale
import os
def getCurrentTimeForFileName():
"""Gets the current time in YYYYMMDDhhmmss format."""
now = datetime.datetime.now()
return now.strftime("%Y%m%d_%H%M%S")
@ProjectEli
ProjectEli / Loop over column
Created January 9, 2025 05:55
OriginLab loop over column
loop (i,1,5) {
wcol(j+i-1)=wcol(i)/max(wcol(i));
}