Skip to content

Instantly share code, notes, and snippets.

@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));
}
@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")
#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 / 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;
@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 / 레벨별 스탯포인트
Last active August 3, 2024 08:11
테일즈위버 재분배 관련
# 자동 재분 업데이트 ref: https://tales.nexon.com/News/DevNote/698?pageSize=20
# 1~255 ref: https://tw-chapter.tistory.com/230
# 원래 테일즈 가이드북에 있었으나 현재 소실된것으로 추정
# 255~310 ref: https://blog.naver.com/tatelulove4
# 직접 눌러보면서 구현된 것 리버스 엔지니어링
2~6 = 2
7~22 = 3
23~48 = 4
49~80 = 5
81~129 = 6
@ProjectEli
ProjectEli / Make C# dll with cdecl support for autohotkey.md
Last active July 29, 2024 08:49
Make C# dll with cdecl support for autohotkey

Why this gist needs?

Autohotkey library supports DllCall() and it can call dll with standard decl feature of c dll. However, typical c# library runs on IL and cannot be called from autohotkey. To support standard dll call, DllExport package is required in Visual Studio.

Step by step

1. Create C# .Net framework library project in Visual studio

image

2. Set projectName

The name will be automatically set to the namespace. image

@ProjectEli
ProjectEli / Philips_328E_6500K_smart_uniformity
Last active November 8, 2021 06:54
Philips 328E (ProjectEli measured)
Wavelength(nm) Relative_spectral_irradiance(a.u.)
166.7 10.1667
167.18 12.3333
167.659 17.1111
168.139 21.8889
168.618 24.5556
169.098 23.5556
169.577 21.6667
170.057 20.5556
170.536 21.3333
@ProjectEli
ProjectEli / Alpaca.py
Created July 7, 2021 14:51
알파카 - GPT-3를 사용한 음성인식
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
# https://cloud.google.com/translate/docs/basic/quickstart?hl=ko
def translate_text(target, text):
"""Translates text into the target language.
Target must be an ISO 639-1 language code.
See https://g.co/cloud/translate/v2/translate-reference#supported_languages
@ProjectEli
ProjectEli / MATLAB_struct_innerval_looptest.m
Created May 19, 2021 02:16
Check lazy copy behavior of struct in MATLAB
% ref: https://kr.mathworks.com/matlabcentral/answers/719-declaring-many-variables-from-work-space-into-function-workspace
%% Init
close all; clear; clc; disp(mfilename);
N=5;
%% Main
S = struct;
S.increment = 1;
S.x = 0;
S = allocatelargevariable(S);