Skip to content

Instantly share code, notes, and snippets.

@wschwarz
wschwarz / xslt-transform.ps1
Last active January 6, 2022 21:25
Powershell script to run an xslt transform on a passed in file.
function process-XSLT
{param([string]$a)
$xsl = "C:\path_to_xslt\CleanUp.xslt"
$inputstream = new-object System.IO.MemoryStream
$xmlvar = new-object System.IO.StreamWriter($inputstream)
$xmlvar.Write("$a")
$xmlvar.Flush()
$inputstream.position = 0
$xml = new-object System.Xml.XmlTextReader($inputstream)
@wschwarz
wschwarz / upload_image.php
Created March 1, 2013 07:26
Simple php script to upload .jpg files from a folder to a bucket with file name format file_name_1.jpg
<?php
require 'vendor/autoload.php';
use Aws\Common\Aws;
use Aws\S3\Exception\S3Exception;
$aws = Aws::factory('/path_to_config/config.php');
$s3 = $aws->get('s3');
@wschwarz
wschwarz / list_buckets.php
Last active December 14, 2015 08:09
Simple s3 list buckets script using phpsdk v2
<?php
require 'vendor/autoload.php';
use Aws\Common\Aws;
use Aws\S3\Exception\S3Exception;
$aws = Aws::factory('/path/config.php');
$s3v2 = $aws->get('s3');