Skip to content

Instantly share code, notes, and snippets.

sbt> eval new scala.sys.SystemProperties().toSeq.sortBy(_._1).foreach(println _)
sbt> eval scala.sys.env.toSeq.sortBy(_._1).foreach(println _)
@mpicker0
mpicker0 / .bashrc
Last active July 20, 2024 19:31
Configuring IntelliJ's terminal to run Cygwin
# Add to your .bashrc so the terminal starts in the project directory
if [[ ${INTELLIJ} == "true" ]]; then
cd ${OLDPWD}
fi
# Note that this works in IntelliJ 14, but not in 16.
# Change the shell path in IntelliJ's Tools > Terminal to:
# C:\cygwin64\bin\env INTELLIJ=true TERM=cygwin C:\cygwin64\bin\bash.exe --login -i
@mpicker0
mpicker0 / Create-WebConfigTransform.ps1
Created May 30, 2013 18:38
This PowerShell script runs a Web.config transformation. Visual Studio must be installed, and MSBuild.exe in your path. This is useful for one-off testing.
<#
.SYNOPSIS
Create a configuration transformation
.DESCRIPTION
This script runs an ASP.NET configuration transformation, given a source
configuration and transformation file. MSBuild.exe is assumed to be in
the path, and Visual Studio 2012 should be installed. Modify the path to
Microsoft.Web.Publishing.Tasks.dll if a different version of Visual Studio
is installed.
@mpicker0
mpicker0 / VCVarsQueryRegistry.ps1
Created May 22, 2013 12:42
Conversion of VsDevCmd.bat and VCVarsQueryRegistry.bat into PowerShell. These scripts set up your command-line environment to run Visual Studio 2012 commands. I was annoyed that there were only batch file versions, so I converted them to PowerShell. Very little attempt has been made to make these scripts PowerShell-like; they are more or less st…
param([Parameter(Mandatory=$false)][string]$Query32Bit = "32bit",
[Parameter(Mandatory=$false)][string]$Query64Bit = "64bit")
Function Get-WindowsSdkDir()
{
if (${Global:WindowsSdkDir})
{
Remove-Variable -Name "WindowsSdkDir" -Scope Global
}
@mpicker0
mpicker0 / gist:5319122
Last active December 15, 2015 20:29
Using a stylesheet also on Gist, batch convert all my GetSimple CMS XML files to Jekyll HTML files.
#!/usr/bin/env bash
for xmlfile in *xml
do
basename=${xmlfile%.*}
xsltproc ~/gs_to_jekyll.xsl ${xmlfile} \
| perl -MHTML::Entities -ne 'print decode_entities($_)' \
> /tmp/pages/${basename}.html
done
@mpicker0
mpicker0 / gs_to_jekyll.xsl
Created April 4, 2013 16:02
I'm converting my site from GetSimple CMS to Jekyll. This converts a GetSimple CMS XML data file to an .html file for Jekyll, containing the proper YAML front matter.
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>---</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>title: </xsl:text>