Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
This will return the full Git commit SHA of whichever branch is currently checkedout.
Dump the snippet into terraform console
(run from within a Git repo) to see for yourself.
# Put this code in your PowerShell profile script | |
# This requires the MSTerminalSettings module which you can download with: | |
# Install-Module MSTerminalSettings -Scope CurrentUser -Repository PSGallery | |
Import-Module MSTerminalSettings | |
$msTermProfileName = 'pwsh' # Replace with whatever Terminal profile name you're using | |
$msTermProfile = Get-MSTerminalProfile -Name $msTermProfileName | |
$script:bombThrown = $false | |
function prompt { | |
if ($? -eq $false) { |
;;; ob-powershell.el --- org-babel functions for powershell evaluation | |
;; Authors: Chris Bilson | |
;; Keywords: literate programming, reproducible research | |
;; Homepage: http://orgmode.org | |
;;; Commentary: | |
;; Org-Babel support for evaluating powershell source code. |
-- This is a script to provide git branch autocompletion to clink | |
-- which can be used in windows cmd, conemu and cmder | |
-- | |
-- Ctrl-Q in conemu to reload Clink Lua scripts | |
-- Clink match generators: https://github.com/mridgers/clink/blob/master/docs/clink.md#user-content-match-generators | |
-- based on: | |
-- https://gist.github.com/sweiss3/9858452 | |
-- https://gist.github.com/bhank/a85113b06632fc52f053533f81c2da2d |
<# | |
.SYNOPSIS | |
Locates Java versions and optionally sets JAVA_HOME and JRE_HOME. | |
.DESCRIPTION | |
The Find-Java function uses PATH, JAVA_HOME, JRE_HOME and Windows Registry to retrieve installed Java versions. | |
If run with no options, the first Java found is printed on the console. | |
.PARAMETER Vendor | |
Selects Java vendor, currently supports Oracle, OpenJDK and IBM. Defaults to Any. | |
.PARAMETER Architecture | |
What processor architecture to match. Valid options are 32, 64, Match and All. Match detects what integer size is used for the PowerShell process, and matches the architecture. If Wow64 is available, 64 bit versions of Java are selected first. |
-- Ctrl-Q in conemu to reload Clink Lua scripts | |
-- Clink match generators: https://github.com/mridgers/clink/blob/master/docs/clink.md#user-content-match-generators | |
-- Strings: http://lua-users.org/wiki/StringLibraryTutorial | |
-- Patterns: http://lua-users.org/wiki/PatternsTutorial | |
-- Escaping: http://www.lua.org/pil/20.2.html | |
-- local: http://www.lua.org/pil/4.2.html | |
-- git commands which will autocomplete branch names after them: | |
local git_commands = {"checkout", "co", "merge", "branch -d", "branch -D"} |
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound) |
# Load | |
Split-Path $MyInvocation.MyCommand.Path -Parent | Push-Location | |
Get-ChildItem poco_*.ps1 | %{. $_} | |
Pop-Location | |
function Select-Poco | |
{ | |
Param | |
( | |
[Object[]]$Property = $null, |
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'forecast_io' | |
ForecastIO.api_key = 'xxxxxxxxxxxx' | |
forecast = ForecastIO.forecast(44.047889,-91.640439) | |
if ARGV[0] == "current" | |
print "#{forecast.currently.temperature.round}, #{forecast.currently.summary}" |