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
$godMode = "$env:userprofile\Desktop\GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}" | |
if (!(Test-Path -Path $godMode)) { | |
mkdir $godMode | |
} |
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[]]$targetDirectories = $(throw "targetDirectories parameter is required"), | |
[string]$size = "1920x1280" | |
) | |
function getUrl ($imageNumber) { | |
$monthNumber =[System.DateTime]::Today.Month | |
$monthName = [System.Globalization.DateTimeFormatInfo]::InvariantInfo.GetAbbreviatedMonthName($monthNumber).ToLower() | |
$imageId = 4 * ($monthNumber - 1) + $imageNumber | |
$urlFormat = "http://ecalendar.thomsonreuters.com/download.asp?size={0}&mo={1}&id={2}" |
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
function Get-Volunteers { | |
[CmdletBinding()] | |
param( | |
[int]$count = 1, | |
[array]$values = @(), | |
[string]$file = "" | |
) | |
if ($file -ne "") { | |
Get-Content $file | % { $values += $_ } |
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
# Description: | |
# A couple of PowerShell helper functions to interact with | |
# http://gitignore.io. These functions will allow you to | |
# list the terms recognized by http://gitignore.io as well | |
# as generate .gitignore files. | |
# | |
# Install: | |
# Save this file to your machine and dot source it in your PowerShell | |
# profile. |
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
DataTable data = SqlDataSourceEnumerator.Instance.GetDataSources(); | |
foreach(DataRow row in data.Rows) { | |
string server = row["ServerName"].ToString(); | |
string instance = row["InstanceName"].ToString(); | |
if (!string.IsNullOrWhiteSpace(instance)) { | |
server += "\\" + instance; | |
} | |
Console.WriteLine(server); | |
} |
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
$global:cpuMonitor = $null | |
function Enable-CpuMonitor() { | |
if ($global:cpuMonitor -eq $null) { | |
$global:cpuMonitor = New-Object Timers.Timer | |
$global:cpuMonitor.Interval = 3000 | |
$global:cpuMonitor.Enabled = $true | |
Register-ObjectEvent -InputObject $global:cpuMonitor -SourceIdentifier CpuMonitor -EventName Elapsed -Action { | |
$processor = Get-WmiObject win32_processor |
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
$global:batteryMonitor = $null | |
function Enable-BatteryMonitor() { | |
if ((Get-WmiObject win32_battery) -eq $null) { | |
Write-Host "No battery found." | |
return | |
} | |
if ($global:batteryMonitor -eq $null) { | |
$global:batteryMonitor = New-Object Timers.Timer |
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
sublime.active_window().active_view().encoding() |
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
function Invoke-Elasticsearch { | |
[CmdletBinding()] | |
Param( | |
[Uri]$Uri, | |
[Microsoft.PowerShell.Commands.WebRequestMethod]$Method = 'Get', | |
$Body = $null, | |
[PSCredential]$Credential | |
) | |
$headers = @{} |
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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
$SolutionDir | |
) | |
$SolutionDir = Resolve-Path $SolutionDir | |
$nugetTargetsPath = Join-Path $SolutionDir ".nuget\nuget.targets" | |
$nugetExePath = Join-Path $SolutionDir ".nuget\nuget.exe" |
OlderNewer