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
| package main | |
| import "fmt" | |
| // Regular function | |
| func greetUser(name string) string { | |
| return "Hello, " + name | |
| } | |
| // Function that takes a function as parameter |
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
| #Requires AutoHotkey v2.0.2+ | |
| #SingleInstance Force | |
| ; Just assign and go | |
| userName := "Bob" | |
| userAge := 25 | |
| ; Same variable, different types? No problem! | |
| score := 100 | |
| score := "high" ; Totally fine in AHK |
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
| package main | |
| import "fmt" | |
| func main() { | |
| // Explicit typing | |
| var userName string = "Bob" | |
| var userAge int = 25 | |
| // Type inference with := |
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
| javascript:(function() | |
| {if(window.__grabberInstalled) | |
| {alert('Auto-grabber already running!');return;}function activeEl(doc) | |
| {doc=doc||document;let el=doc.activeElement;if(el&&el.shadowRoot) | |
| {el=el.shadowRoot.activeElement||el;}if(el&&el.tagName==='IFRAME') | |
| {try | |
| {return activeEl(el.contentDocument)||el;}catch(e) | |
| {}}return el;}async function copyNow() | |
| {let el=activeEl();let txt='';if(!el) | |
| {return;}if(el.isContentEditable) |
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
| #Requires AutoHotkey v1.1.33+ | |
| #SingleInstance,Force | |
| Menu, tray, icon, vlc.ico, 1 ;update this to your path to icon | |
| Browser_Forward::Reload | |
| ;****************************** | |
| Browser_Back:: ;Set your hotkey to play/pause here | |
| ControlSend,,{space},ahk_exe vlc.exe ;Send space to VLC player control | |
| Clipboard:=ACCGet("Name","4.3.3.1",0, "ahk_exe vlc.exe") "`t" ;Get the current time stamp and add tab | |
| word := ComObjActive("Word.Application") ;If you're using Word, this will connect to MS word | |
| word.Selection.Paste() ;And this will paste the time and tab in MS word |
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
| #Requires AutoHotkey v1.1.33+ | |
| #SingleInstance, Force ;Limit one running version of this script | |
| #NoEnv ;Avoids checking empty variables to see if they are environment variables | |
| :*X:cal::Snd("https://the-Automator.com/1HourConsult") ;type cal sends HotString | |
| :*X:con::Snd("https://the-Automator.com/Consult") ;type con sends HotString | |
| Snd(str){ | |
| clipsave := ClipboardAll ;backup clipboard | |
| Clipboard := "" |
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
| *///////////////. DEFINE !DDN (DupVar !TOKENS (1)) SORT CASES BY !DupVar (A) . MATCH FILES /FILE = * /BY !DupVar /FIRST = First. var label first "Unique and Duplicates". value label first 0'Duplicates' 1'Unique'. Freq First /FORMAT=DVALUE. select if First=1. match files file= * / drop First. exe. !ENDDEFINE. *///////////////. /* !DDN DupVar=Number. *////SPSS macro to remove duplicates on String variable///////////. DEFINE !DDA (DupVar !TOKENS (1)) String duh (A1000). SORT CASES BY !DupVar (A) . compute duh=Lowcase(!DupVar). MATCH FILES /FILE = * /BY Duh /FIRST = First. var label first "Unique and Duplicates". value label first 0'Duplicates' 1'Unique'. Freq First /FORMAT=DVALUE. select if First=1. match files file= * / drop First duh. exe. !ENDDEFINE. *///////////////. /* !DDA DupVar=email. *///////////////. DEFINE !DDM (Var1 !TOKENS (1) / Var2 !Tokens (1) ) String duh1 duh2 (A1000). Compute duh1=Lowcase(!Var1). Compute duh2=Lowcase(!Var2). SORT CASES BY Duh1 (A) Duh2 (A). MATCH FILES /FILE = * /BY Duh1 Duh2 / |
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
| ; Want a clear path for learning AutoHotkey? Go to https://the-Automator.com/Learn | |
| ; https://www.autohotkey.com/docs/v2/lib/_HotIf.htm | |
| #SingleInstance | |
| #Requires Autohotkey v2.0+ | |
| #HotIf MouseIsOver("ahk_class Shell_TrayWnd") | |
| WheelUp::Send "{Volume_Up}" | |
| WheelDown::Send "{Volume_Down}" | |
| MouseIsOver(WinTitle) { |
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
| ;~ ~AppsKey & h::Run Excel.exe C:\Users\Joe\Dropbox\diet.xlsx ;diet |
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
| ;******************************************************* | |
| ; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey courses. | |
| ;They're structured in a way to make learning AHK EASY: https://the-Automator.com/Learn | |
| ;******************************************************* | |
| ;~ #Include <default_Settings> | |
| #Requires AutoHotkey v1.1.33+ | |
| ;************************************** | |
| #SingleInstance force | |
| #Requires AutoHotkey v1.1.36+ ; prefer 64-Bit | |