Skip to content

Instantly share code, notes, and snippets.

View turboBasic's full-sized avatar
🔮
Focusing

andriy melnyk turboBasic

🔮
Focusing
View GitHub Profile
@turboBasic
turboBasic / Help-PSgist.url
Last active July 10, 2017 02:51
Gets page with the hyperlinked list of all commands in PSgist module. Preferable way to consume help
dotps1.github.io/PSGist/cmdlets.html
@turboBasic
turboBasic / Get-EnumValues.ps1
Last active September 8, 2017 07:54
[Get Enum values] Get all possible values of Enum type. Answers question "How do I get all possible values of variable of Enum type when the type is not known?" #powershell
# Get all possible values of variable of dynamic Enum type
function Get-EnumInformation( [Object] $thing ) {
if( $thing -is [Enum] ) {
$type = $thing.getType()
} elseif( ($thing -as [Type]).baseType.fullName -eq 'System.Enum' ) {
$type = $thing -as [Type]
} else {
return $null
}
@turboBasic
turboBasic / Get-KnownFolders.ps1
Last active September 7, 2017 06:11
[Get list of all known folders] in Windows, even if user moved them to other non-standard locations. Answers the questions "How do I learn the path to the Desktop/Start Menu/Send To etc. directories?" #powershell #windows
$result = [ordered]@{};
[Environment+SpecialFolder].GetEnumNames() |
Sort |
ForEach {
$result += @{
$_ = [Environment]::GetFolderPath($_)
}
}
$result
@turboBasic
turboBasic / Test-PipelineAndArgumentBindingExample.ps1
Last active September 9, 2017 10:33
[Get-ArgumentBindingExample.ps1] Template powershell function with placeholders explaining advanced argument binding which happens in Powershell. Usage: see comment inside #powershell
Function Test-PipelineAndBinding {
# Usage:
#
# . .\Test-PipelineAndBinding.ps1
# Test-Self
[CMDLETBINDING(PositionalBinding=$False)]
[OUTPUTTYPE([String[]])]
PARAM(
@turboBasic
turboBasic / ulister_byCode.txt
Last active September 14, 2024 03:12
[uLister filetype codes] Type codes for uLister - viewer plugin for Total Commander. Source: https-pastebin.com/JpnH2Y7t #totalCommander
Code Type
---- ----
1000 Word for DOS 4.x
1001 Word for DOS 5.x
1002 Wordstar 5.0
1003 Wordstar 4.0
1004 Wordstar 2000
1005 WordPerfect 5.0
1006 MultiMate 3.6
1007 MultiMate Advantage 2
@turboBasic
turboBasic / linkQR.png
Last active August 17, 2017 22:42
QR with link to github profile
linkQR.png
@turboBasic
turboBasic / 0_reuse_code.js
Created August 29, 2017 15:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@turboBasic
turboBasic / Get-ChromeExtensionSettings-Context.txt
Last active December 1, 2017 12:12
[Get-ChromeExtensionSettings-Context] settings for chrome extension "Context" #chrome
eyJ2ZXJzaW9uIjoxLCJjb250ZXh0cyI6W3sibmFtZSI6IkVtcHR5IiwiaW1nU3JjIjoiaWNvbnMvZG9ydG11bmQvY29uZmlnLnBuZyIsImljb24iOiJzaG93X2NvbnRleHQiLCJleHRlbnNpb25zIjpbXX0seyJuYW1lIjoiTWluIiwiaW1nU3JjIjoiaWNvbnMvZG9ydG11bmQvc3Rhci5wbmciLCJpY29uIjoic2hvd19jb250ZXh0IiwiZXh0ZW5zaW9ucyI6W3siaWQiOiJnaWdobW1waW9ia2xmZXBqb2NuYW1na2tiaWdsaWRvbSIsImljb24iOiJjaHJvbWU6Ly9leHRlbnNpb24taWNvbi9naWdobW1waW9ia2xmZXBqb2NuYW1na2tiaWdsaWRvbS8xNi8wIn0seyJpZCI6Imhkb2tpZWpucGltYWtlZGhhamhkbGNlZ2VwbGlvYWhkIiwiaWNvbiI6ImNocm9tZTovL2V4dGVuc2lvbi1pY29uL2hkb2tpZWpucGltYWtlZGhhamhkbGNlZ2VwbGlvYWhkLzE2LzAifV19LHsibmFtZSI6IlNoYXJlIiwiaW1nU3JjIjoiaWNvbnMvZG9ydG11bmQvY3VzdG9tZXJzLnBuZyIsImljb24iOiJzaG93X2NvbnRleHQiLCJleHRlbnNpb25zIjpbeyJpZCI6InBkY29oa2hoamJpZmttcGFrYWlvcG5sbG5kZG9mYmJuIiwiaWNvbiI6ImNocm9tZTovL2V4dGVuc2lvbi1pY29uL3BkY29oa2hoamJpZmttcGFrYWlvcG5sbG5kZG9mYmJuLzE2LzAifSx7ImlkIjoicGlvY2xwb3BsY2RiYWVmaWhhbWpvaG5lZmJpa2ppbGMiLCJpY29uIjoiY2hyb21lOi8vZXh0ZW5zaW9uLWljb24vcGlvY2xwb3BsY2RiYWVmaWhhbWpvaG5lZmJpa2ppbGMvMTYvMCJ9LHsiaWQiOiJnb2piZGZucG5ob2dm
@turboBasic
turboBasic / Invoke-FirefoxBookmarkManager.ps1
Last active September 9, 2017 00:22
[Invoke-FirefoxBookmarkManager.ps1] launch Firefox with bookmarks library window only #firefox #cmd #powershell
& "C:\Program Files\Firefox Developer Edition\firefox.exe" -chrome chrome://browser/content/places/places.xul
@turboBasic
turboBasic / bitnessRuler.txt
Last active March 9, 2019 09:36
Bitness ruler for measuring length of text (eg. private keys, passwords etc.) expressed in bits
╷ ╷ ╷ ╷ ╷ ╷
64 128 256 512 768 1024