Skip to content

Instantly share code, notes, and snippets.

View pbrumblay's full-sized avatar

Peter Brumblay pbrumblay

  • Tyr Consulting, LLC
  • Denver, CO
View GitHub Profile
@pbrumblay
pbrumblay / SplitTableRowsIntoPartitions.java
Last active August 9, 2023 09:34
Apache Beam writing TableRows by partition column using FileIO writeDynamic
package com.fearlesstg.dataflow.pipelines;
import java.util.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.api.services.bigquery.model.TableRow;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.io.Compression;
import org.apache.beam.sdk.io.FileIO;
@pbrumblay
pbrumblay / zipdirectory.ps1
Last active December 23, 2015 00:09
Powershell ZipFile Example (requires .NET 4.5)
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem');
[System.IO.Compression.ZipFile]::CreateFromDirectory($directoryTozip, "$output.zip");
@pbrumblay
pbrumblay / ftpsupload.ps1
Last active September 23, 2020 16:07
Powershell FTPS Upload Example
param (
[string]$file = $(throw "-file is required"),
[string]$ftphostpath = $(throw "-ftphostpath is required"),
[string]$username = $(throw "-username is required"),
[string]$password = $(throw "-password is required")
)
$f = dir $file
$req = [System.Net.FtpWebRequest]::Create("ftp://$ftphostpath/" + $f.Name);
$req.Credentials = New-Object System.Net.NetworkCredential($username, $password);