Skip to content

Instantly share code, notes, and snippets.


Darren Fuller dazfuller

View GitHub Profile
dazfuller / main.ts
Created April 17, 2022 17:48
Some prime number calculations using TypeScript
View main.ts
/* eslint-disable max-len */
import { stdout } from 'process';
* Approximates the nth prime number. This goes deliberately high so that we get a few more prime numbers
* and avoid cutting the sequence early.
* @param n The nth prime number to approximate
* @returns An approximation of the nth prime
function approximateNthPrime(n: number): number {
dazfuller / .\templates\function-app.bicep
Last active February 14, 2023 07:50
Example template for deploying an Azure Function app with KeyVault references all set in Bicep
View .\templates\function-app.bicep
** Parameters
@description('Prefix to be used by all resources deployed by this template')
param resourcePrefix string = 'demo'
dazfuller / Pipfile
Last active February 27, 2023 23:17
Multi-process loading of data into MySQL from Python
View Pipfile
name = "pypi"
url = ""
verify_ssl = true
mysql-connector-python = "*"
dazfuller / Program.cs
Created December 16, 2019 08:08
Adding multiple tables to a worksheet using EPPlus
View Program.cs
using System.IO;
using OfficeOpenXml;
namespace dotnet_excel_demo
class Program
static void Main(string[] args)
using var package = new ExcelPackage();
dazfuller / azuredeploy.json
Last active October 1, 2021 15:42
Azure Data Lake Gen 2 - ARM template
View azuredeploy.json
"$schema": "",
"contentVersion": "",
"parameters": {
"resourcePrefix": {
"type": "string",
"minLength": 3,
"maxLength": 10,
"metadata": {
"description": "The prefix to use for resources within the resource group"
dazfuller /
Last active August 17, 2018 15:29
Calling an Azure Active Directory (AAD) secured Azure Function from Python
import json
import requests
with open('settings.json', 'r') as fp:
settings = json.load(fp)
CLIENT_ID = settings['clientId']
CLIENT_SECRET = settings['clientSecret']
TENANT_ID = settings['tenantId']
APP_ID_URI = settings['appIdUri']
dazfuller / Program.cs
Last active February 9, 2018 16:31
Reading Parquet from Azure Blob
View Program.cs
using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Parquet;
namespace ParquetFromAzureBlob
public static class Program
private const string AccountName = "<account name>";
dazfuller /
Last active April 27, 2023 19:54
Exporting data from a database to Parquet files in .NET (Core). This demo application targets a SQL Server database but the code could be re-used to target other database solutions.

MIT License

Copyright (c) 2018 Darren Fuller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

dazfuller / Get-AzureRmVMPrivateIPAddresses.ps1
Created June 14, 2017 11:40
Find the primary private IP address of VMs in Azure
View Get-AzureRmVMPrivateIPAddresses.ps1
$VMs = Get-AzureRmVM
$Results = @()
ForEach ($VM in $VMs)
ForEach ($NicID in $VM.NetworkInterfaceIDs)
$Nic = Get-AzureRmResource -ResourceId $NicID | Get-AzureRmNetworkInterface
$Result = New-Object PSObject
$Result | Add-Member -MemberType NoteProperty -Name "ResourceGroupName" -Value $VM.ResourceGroupName
View EnableAuditAndThreatDetection.ps1
A runbook which will enable security settings for all database servers and databases in a subscription
AUTHOR: @dazfuller
LASTEDIT: Jan 30, 2016
$connectionName = "AzureRunAsConnection"