💡 The 2020 Pantone Color of the Year is Classic Blue

PANTONE 19-4052 Classic Blue: Instilling calm, confidence, and connection, this enduring blue hue highlights our desire for a dependable and stable foundation on which to build as we cross the threshold into a new era. 💡

Mac OS X Hints: Set the language for a single application

defaults write com.microsoft.Excel AppleLanguages '("ru-RU")'
defaults write com.microsoft.Word AppleLanguages '("ru-RU")'
defaults write com.microsoft.Powerpoint AppleLanguages '("ru-RU")'

defaults write com.apple.iTunes AppleLanguages '("ru-RU")'
defaults write com.apple.TextEdit AppleLanguages '("en-US")'

Continue reading Mac OS X Hints: Set the language for a single application

Powershell 3.0: Save posters from TMDb

очень простой листинг для сохранения постеров (на входе — имя файла, скачивание через Invoke-WebRequest, нужен api_key)


Param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true,HelpMessage="Provide a full path to movie files")]
[alias("p")]
[ValidateScript({ $_.Replace("[", "“[").Replace("]", "“]"); Test-Path -Path $_ -PathType 'Container'})]
[System.String]$path,
[Parameter(Position=1,ValueFromPipeline=$true)]
[alias("api")]
[int]$apikey = "098f6bcd4621d373cade4e832627b4f6" # Get your own! https://developers.themoviedb.org/3/getting-started/authentication
)
Add-Type -AssemblyName System.Web
Get-ChildItem -Path $path -Force | ?{!$_.PSIsContainer -and $_.Name -match "\.(avi|mkv|mp4|xvid)$"} | Select -First 10 | %{
$dir = $_.Directory.Fullname
$imdburi = "https://api.themoviedb.org/3/search/movie?query={0}&language=ru-RU&api_key={1}" -f [System.Web.HttpUtility]::UrlEncode([System.IO.Path]::GetFileNameWithoutExtension($_.Name)), $apikey
$movie = Invoke-WebRequest -Uri $imdburi
(ConvertFrom-Json $movie.Content).results | Select -First 1 | %{
#$r = Invoke-WebRequest -Uri ("https://api.themoviedb.org/3/movie/{0}/images?api_key={1}" -f $_.id, $apikey)
#$images = (ConvertFrom-Json $r).backdrops
$filename = "{0} – {1} ({2}){3}" -f $_.original_title, $_.title, ([datetime]::Parse($_.release_date)).Year, [System.IO.Path]::GetExtension($_.poster_path)
$filename = $filename -replace ":",' – ' -replace ' {2}', ' '
$filename = ([char[]]$filename | ?{[IO.Path]::GetinvalidFileNameChars() -notcontains $_ }) -join ''
Invoke-WebRequest -Uri ("https://image.tmdb.org/t/p/w640"+$_.poster_path) -OutFile "$dir\$filename"
}
}