This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/bash | |
| # Recursively rename all files in current directory and subdirectories | |
| # to standardized names (only a-z, A-Z, 0-9, _, and .) | |
| # Start in current directory (or pass a path as first argument) | |
| BASE_DIR="${1:-.}" | |
| # Find all files (not directories) | |
| find "$BASE_DIR" -type f | while read -r file; do | |
| dir=$(dirname "$file") | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ; AutoHotkey v2 script to switch between windows of the same application using Alt + ` | |
| !`:: { | |
| ; Get the process name of the active window | |
| activeProcess := WinGetProcessName("A") | |
| ; Get a list of all windows matching the process name | |
| windowList := [] | |
| for window in WinGetList("ahk_exe " . activeProcess) { | |
| if WinGetTitle(window) { | |
| windowList.Push(window) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import sys | |
| import re | |
| if __name__ == '__main__': | |
| # tex-bib-filter.py <source_tex_file.tex> <bib_item_file.bib> | |
| tex_file, bib_file = sys.argv[1: 3] | |
| print(tex_file, bib_file) | |
| re_cite_key = re.compile(r'\\cite{(.*?)}') | |
| # \bibitem{dosovitskiy2021an} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import os | |
| import xml.etree.ElementTree as ET | |
| def convert_bbox(cx, cy, w, h): | |
| # Convert (cx, cy, w, h) to (xmin, ymin, xmax, ymax) | |
| xmin = cx - (w / 2) | |
| ymin = cy - (h / 2) | |
| xmax = cx + (w / 2) | |
| ymax = cy + (h / 2) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import pandas as pd | |
| from pypika import Query, Table | |
| from tqdm import tqdm | |
| import re | |
| re_utf_string = re.compile(r"\'(?=\w)") | |
| xls_file_path = "./demo.xlsx" | |
| xls = pd.ExcelFile(xls_file_path) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import cv2 | |
| import json | |
| from os import path as osp | |
| import sys | |
| import json | |
| CATES = { | |
| "Beer": 0, | |
| "Alcohol": 1, | |
| "Sextoy": 2 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | oh-my-posh init pwsh --config "~\AppData\Local\Programs\oh-my-posh\themes\emodipt-extend.omp.json" | Invoke-Expression | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | let user = { | |
| firstName: "John", | |
| sayHi() { | |
| alert(`Hello, ${this.firstName}!`); | |
| } | |
| }; | |
| setTimeout(user.sayHi, 1000); // Hello, undefined! | |
| /* | |
| In line 8, user.sayHi is passed into `setTimeout`, then its lexical environment is setTimeout's closure. So it has no idea where is this reference -> unidentified with this.name in line 4 |