Skip to content

Instantly share code, notes, and snippets.

View glennsarti's full-sized avatar
✍️
Writing code that's soon to be legacy...

Glenn Sarti glennsarti

✍️
Writing code that's soon to be legacy...
View GitHub Profile
@glennsarti
glennsarti / GetPR.BAT
Last active July 14, 2016 22:44
Dev Environment Scripts
@ECHO OFF
SETLOCAL
SET /P PROJECT=Enter project name (e.g. puppet):
SET /P PRNUM=Enter PR number (e.g. 12345):
SET REPO=%~dp0%PROJECT%-pr%PRNUM%
ECHO Cleaning...
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
# Based on https://gist.github.com/ferventcoder/947479688d930e28d632
#TODO
#uru 1.9.3
#gem sources -a http://rubygems.org
#gem sources -r https://rubygems.org
#gem update --system
#gem sources -r http://rubygems.org
@glennsarti
glennsarti / RunTest.BAT
Last active March 7, 2016 17:20
Automated testing for MSIs on VM Pooler for PA-231
@ECHO OFF
SETLOCAL
SET COMP=<poolername>.delivery.puppetlabs.net
SET UNAME=administrator
SET PWD=<password>
NET USE \\%COMP%\c$ /user:%UNAME% %PWD%
@ECHO OFF
ECHO Installing chocolatey...
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
ECHO Refreshing env...
CALL "C:\ProgramData\chocolatey\bin\RefreshEnv.cmd"
ECHO Installing Chrome and VC Redist 2010...
choco install googlechrome vcredist2010 -y
@glennsarti
glennsarti / ConvertJSONToCypher.ps1
Created July 10, 2015 04:04
These two scripts can be used to convert the data from the Star Wars API (http://swapi.co) into an import file for Neo4j. These scripts download the JSON data from the API and converts it into Cypher statements. It's crude and probably not the best way to do it, but, it works!. Firstly download the JSON data using GetSWAPI.ps1, and then run Conv…
$ErrorActionPreference = 'Stop'
$VerbosePreference = 'SilentlyContinue'
Function Safe-CypherString($value) {
$value = $value.Replace('\','\\').Replace("`n",'\n').Replace("`r",'\r').Replace("'","\'")
Write-Output $value
}
Function Convert-JSONToCypher($dataObject) {