Skip to content

Instantly share code, notes, and snippets.

View Gewerd-Strauss's full-sized avatar

Gewerd-Strauss

  • Germany
View GitHub Profile
@anonymous1184
anonymous1184 / Ini.ahk
Last active October 31, 2024 14:35
Automatic configuration file handling.

; Version: 2023.04.20.1
; Usages and examples: https://redd.it/s1it4j
Ini(Path, Sync := true) {
return new Ini_File(Path, Sync)
}
class Ini_File {
@anonymous1184
anonymous1184 / Acc.ahk
Last active August 9, 2024 04:40
Acc.ahk
#Requires AutoHotkey v2.0
; Version: 2023.09.22.1
; https://gist.github.com/58d2b141be2608a2f7d03a982e552a71
; Private
Acc_Init(Function) {
static hModule := DllCall("LoadLibrary", "Str", "oleacc.dll", "Ptr")
return DllCall("GetProcAddress", "Ptr", hModule, "AStr", Function, "Ptr")
}
@anonymous1184
anonymous1184 / GetUrl.ahk
Last active September 18, 2024 03:38
GetUrl()
#Requires AutoHotkey v2.0
; Version: 2023.10.05.1
; https://gist.github.com/7cce378c9dfdaf733cb3ca6df345b140
GetUrl() { ; Active Window Only
static S_OK := 0, TreeScope_Descendants := 4, UIA_ControlTypePropertyId := 30003, UIA_DocumentControlTypeId := 50030, UIA_EditControlTypeId := 50004, UIA_ValueValuePropertyId := 30045
hWnd := WinGetID("A")
IUIAutomation := ComObject("{FF48DBA4-60EF-4201-AA87-54103EEF594E}", "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}")
eRoot := ComValue(13, 0)
@anonymous1184
anonymous1184 / README.md
Last active January 19, 2024 04:58
WinHttpRequest.ahk

WinHttpRequest Wrapper

Usage and information: https://redd.it/mcjj4s

AutoHotkey v2.0

  • [WinHttpRequest.ahk]

AutoHotkey v1.1

@anonymous1184
anonymous1184 / HashFile.ahk
Last active December 24, 2023 14:46
Quick File Hashing

; Version: 2023.04.20.1
; Usages and examples: https://redd.it/m0kzdy
; Configuration ↓
wide := true ; Display the full hashes
; Enables/disabled algorithms
use := {}
`?` <- function(condition, result) {
if (missing(result)) return(
utils::`?`(deparse(substitute(condition)))
)
result <- substitute(result)
if (!is.call(result) || !identical(result[[1]], as.symbol(':'))) {
stop("Invalid syntax. Expected <condition> ? <if_true> : <if_false>", call. = FALSE)
}
eval(call("if", condition, result[[2]], result[[3]]))
}
@gadenbuie
gadenbuie / render_toc.R
Last active May 16, 2024 20:09
Generate Manual Table of Contents in (R)Markdown Documents
#' Render Table of Contents
#'
#' A simple function to extract headers from an RMarkdown or Markdown document
#' and build a table of contents. Returns a markdown list with links to the
#' headers using
#' [pandoc header identifiers](http://pandoc.org/MANUAL.html#header-identifiers).
#'
#' WARNING: This function only works with hash-tag headers.
#'
#' Because this function returns only the markdown list, the header for the
@johnatasjmo
johnatasjmo / source_files_from_folder.R
Created January 20, 2018 16:44
R - Source all files within folder
setwd("~/rProgramming")
files.sources = list.files()
sapply(files.sources, source)
@arne-cl
arne-cl / restore_packages.R
Created September 16, 2014 08:46
save/load/install a list of your currently installed R packages
# restore_packages.R
#
# installs each package from the stored list of packages
# source: http://hlplab.wordpress.com/2012/06/01/transferring-installed-packages-between-different-installations-of-r/
load("~/installed_packages.rda")
for (count in 1:length(installedpackages)) {
install.packages(installedpackages[count])
}