Skip to content

Instantly share code, notes, and snippets.

@alshain
alshain / Resolve-Variable.ps1
Last active May 26, 2019 09:30
Resolve-Variable.ps1
# Todo create cmdlet
# TODOs
# Does not properly recognize variable expansions, because GetEnvironmentVariables already does that... probably with the current process' environment variables
#
function GetCurrentUserPathVariableRaw() {
if ($env:USERDOMAIN.Length -eq 0) {
throw "Does not yet support no domains"
}
@alshain
alshain / README.md
Last active April 6, 2019 07:17
C++ Links
@alshain
alshain / kotlin-scripting-knowledge.md
Last active May 19, 2019 21:50
Kotlin Scripting Knowledge

Links

Proposal Discussion

How does the IntelliJ Scripting Console index IntelliJ JARs automatically?

The dependencyResolver of [StandardIdeScriptDefinition][depResolverTarget] checks whether the "RootType" is IdeConsoleRootType, in that case it adds the IDEs + Kotlin's JARs (detected via URLClassLoader, mainly) to the classpath.

See here: https://github.com/JetBrains/kotlin/blob/c248dd29c21699ab22ff6fd7a77f1395c9b58632/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/ScriptDefinitionsManager.kt#L319

@alshain
alshain / 01 REAME.md
Last active January 23, 2019 09:52
IDE Scripting Console - Survive Reload and onFileCHange

Some helper functions to easily test and reload IntelliJ services/extension points by registering handlers in a global object by name.

Also contains minimal amount of boilerplate to get the global IDE object, the project and makes println work.

@alshain
alshain / restart_lcore.ps1
Created December 3, 2018 11:26
Kill and restart "Logitech Gaming Software" when it freezes
Stop-Process -ProcessName LCore
Start-Process "C:\Program Files\Logitech Gaming Software\LCore.exe"
@alshain
alshain / everything.ahk
Last active April 7, 2019 11:42
AutoHotkey to launch Everything via Ctrl-Win-Enter
; Press Ctrl-Win-Enter to show Everything (also works on NumPad)
; Create file in run `install_startmenu_startup_shortcut.bat` to register the file for the currently running user as a startup item.
; ^ Ctrl
; # Windows key
^#Enter::Run "C:\Program Files\Everything\Everything.exe" -togglewindow
; Hmm, when working on notebook attached to full size keyboard
; Ctrl-Win-Numpad works just fine with only the above key.
; Why do I also need this then for the Desktop computer? What gives?
^#NumpadEnter::Run "C:\Program Files\Everything\Everything.exe" -togglewindow
@alshain
alshain / SQL-IN.groovy
Created September 25, 2018 08:37
IntelliJ/DataGrip Data Extractors
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@alshain
alshain / plugin.groovy
Created August 20, 2018 22:01
LivePlugin: Add actions to navigation bar
import com.intellij.ide.ui.customization.ActionUrl
import com.intellij.ide.ui.customization.CustomActionsSchema
import com.intellij.ide.ui.customization.CustomisedActionGroup
import com.intellij.ide.ui.customization.CustomizableActionGroupProvider
import com.intellij.ide.ui.customization.CustomizableActionGroupProvider.CustomizableActionGroupRegistrar
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.extensions.Extensions
import static liveplugin.PluginUtil.*
@alshain
alshain / test
Created August 20, 2018 14:57
Test
test