Skip to content

Instantly share code, notes, and snippets.

private void InstallOpenCoverFromLocalPackage()
{
var settings = new NuGetInstallSettings
{
//Source = new[] { @"..\Tools\LocalPackages\" },
Source = new[] { @"C:\Some\FullPath\Tools\LocalPackages" },
OutputDirectory = "tools"
};
#!/usr/bin/env pwsh
# ./move-ios-media.ps1 '/Users/hudgeo/Desktop/camera'
# ./move-ios-media.ps1 '/Users/hudgeo/Desktop/camera', '/Users/hudgeo/Desktop/iGeoffCamera'
param( [Parameter(Mandatory=$true)] [string[]] $directories )
Write-Host "Using Powershell $($PSVersionTable.PSEdition) v $($PSVersionTable.PSVersion)"
$logFile = "$HOME/Scripts/move-ios-media.txt"
$picsRoot = "$HOME/Pictures/By Year"; $vidRoot = "$HOME/Movies/By Year"
$preview = $false; $autoOpenPathFinder = $true
on run {input, parameters}
do shell script "open /Applications/Preview.app"
set importFromPhoneText to "Import from iGeoff"
tell application "System Events" to tell process "Preview"
set frontmost to true
delay 2
click (menu item 1 where its name starts with importFromPhoneText) of menu 1 of menu bar item "File" of menu bar 1
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateScript({
if (-Not ($_ | Test-Path) ) {
throw "repos root path does not exist"
}
if (-Not ($_ | Test-Path -PathType Container) ) {
throw "Repos root must be a folder"
}
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
param([string]$checkoutBranch = "develop")
function Get-AllRepos ([string]$checkoutBranch = "develop")
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[ValidateRange(1, 180)]
[int]$daysBack = 7,
[Parameter(Mandatory=$false)]
[string]$author,
[Parameter(Mandatory=$false)]
param([switch]$all, [int]$top)
Push-Location $PSScriptRoot
# Eureka takes longest. start first in new window, takes a while, lots of continual Eureka output
"Launching Eureka startup in another process"
Invoke-Expression 'cmd /c start powershell -NoProfile -Command { .\eureka-start.ps1 }'
""
# Start Spring Cloud Config server for Producer and Consumer configuration.
$image = "hyness/spring-cloud-config-server"
$name = "river-cloud-config"
$attempts = 0
$startSuccess = $false
$maxAttempts = 3
$configPath = (Get-Item (Join-Path $PSScriptRoot "../../river-flow-config/local")).FullName.Replace("\", "/")
do {