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
Get-Module -Name ModuleMockExample | Remove-Module | |
New-Module ModuleMockExample { | |
function Hidden { "This is Hidden!" } | |
function Get-Hidden { Hidden } | |
function Get-GetHidden { Get-Hidden } | |
function Private { Write-Output "This was private" } | |
function Get-Public { Write-Output "This was public" } | |
function Get-Private { Private } |
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
param([String]$existingFilename, [String]$newFilename) | |
$signature = @' | |
[DllImport("kernel32.dll", ExactSpelling=true, CharSet=CharSet.Unicode, SetLastError=true)] | |
public static extern uint MoveFileW( | |
string lpExistingFileName, string lpNewFileName); | |
'@ | |
$type = $null | |
try |
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
@echo on | |
REM checked for Windows 10 | |
REM fork from https://gist.github.com/theultramage/cbdfdbb733d4a5b7d2669a6255b4b94b | |
REM you may want full list https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c | |
REM SET attrib=+ATTRIB_HIDE | |
SET attrib=-ATTRIB_HIDE | |
REM Hard disk burst ignore time | |
powercfg -attributes 0012ee47-9041-4b5d-9b77-535fba8b1442 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 %attrib% |
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
/** | |
* Advanced Window Snap (Extended | |
* Snaps the Active Window to one of nine different window positions. | |
* | |
* @Editing author Jarrett Urech | |
* @Original author Andrew Moore <[email protected]> | |
* @version 2.1 | |
* | |
**/ |
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
filter Get-DependencyTree { | |
<# | |
.NOTES | |
From https://gist.github.com/Jaykul/304e7874d629ef4848c9acd0cfd550d0 | |
#> | |
param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[System.Management.Automation.PSModuleInfo[]]$Module, | |
$Depth = 0, |
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 -Module Reflection | |
[CmdletBinding()] | |
param( | |
# The path to a script or name of a command | |
$Command, | |
# If you want to include private functions from a module, make sure it's imported, and pass the ModuleInfo here | |
[System.Management.Automation.PSModuleInfo]$ModuleScope = $( | |
Get-Module $Command -ListAvailable -ErrorAction SilentlyContinue | Get-Module -ErrorAction SilentlyContinue | |
), |
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
# Allows overriding the default paths where Configuration stores it's configuration | |
# Within those folders, the module assumes a "powershell" folder and creates per-module configuration folders | |
PathOverride = @{ | |
# Where the user's personal configuration settings go. | |
# Highest presedence, overrides all other settings. | |
# Defaults to $Env:LocalAppData on Windows | |
# Defaults to $Env:XDG_CONFIG_HOME elsewhere ($HOME/.config/) | |
UserData = "" | |
# On some systems there are "roaming" user configuration stored in the user's profile. Overrides machine configuration | |
# Defaults to $Env:AppData on Windows |
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
# This file lists the color values of the default dark theme. | |
# Each line starting with a # is a comment. | |
# To overwrite certain colors remove the leading # and change the color values. | |
# The "extends" line defines which color definitions to use if none is found here. | |
extends=deepgit-dark-theme.properties | |
# The "preferredEditorTheme" line determines what editor theme should be used by default ('light' or 'dark'). | |
preferredEditorTheme=dark |
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
const Ffmpeg = require(‘fluent-ffmpeg’); | |
const STREAM_URL = ‘http://icecast.radio24.ch/radio24-rc-96-aac'; | |
const VOLUME_THRESHOLD = -50; // volume threshold | |
getMeanVolume(STREAM_URL, function(meanVolume){ | |
if(meanVolume <= VOLUME_THRESHOLD){ | |
console.log(“WE HAVE A PROBLEM! VOLUME IS TOO LOW!”); | |
}else{ | |
console.log(‘ALL GOOD!’); | |
} |
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
<# | |
.SYNOPSIS | |
Get Weather of a City | |
.DESCRIPTION | |
Fetches Weather report of a City from website - http://wttr.in/ courtsey Igor Chubin [Twitter- @igor_chubin] | |
.PARAMETER City | |
Name of City |