Skip to content

Instantly share code, notes, and snippets.

View build.cake
private void InstallOpenCoverFromLocalPackage()
{
var settings = new NuGetInstallSettings
{
//Source = new[] { @"..\Tools\LocalPackages\" },
Source = new[] { @"C:\Some\FullPath\Tools\LocalPackages" },
OutputDirectory = "tools"
};
View move-ios-media.ps1
#!/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
View PreviewImportIphone.AppleScript
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
View git-all-find.ps1
[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"
}
View git-all-delete-merged-branches.ps1
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 $_}
View git-all-fetch.ps1
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 $_}
View git-all-pull.ps1
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
View git-all-log.ps1
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[ValidateRange(1, 180)]
[int]$daysBack = 7,
[Parameter(Mandatory=$false)]
[string]$author,
[Parameter(Mandatory=$false)]
View run-prep.ps1
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.
View docker-cloud-config-start.ps1
$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 {