Skip to content

Instantly share code, notes, and snippets.

View synesthesia's full-sized avatar
💭
I may be slow to respond.

Julian Elve synesthesia

💭
I may be slow to respond.
View GitHub Profile
@synesthesia
synesthesia / Anaconda PowerShell Prompt in Windows Terminal settings.json
Created February 5, 2025 13:46 — forked from guimondmm/Anaconda PowerShell Prompt in Windows Terminal settings.json
Add an "Anaconda PowerShell Prompt" profile to Windows Terminal. Just paste it in your settings.json file.
{
"colorScheme": "Campbell",
"commandline": "pwsh.exe -ExecutionPolicy ByPass -NoExit -Command \"& '%USERPROFILE%\\anaconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%USERPROFILE%\\anaconda3' \"",
"guid": "{e7d34d61-5a57-4f38-8eab-91cb777b0c26}",
"hidden": false,
"icon": "%USERPROFILE%\\anaconda3\\Menu\\anaconda-navigator.ico",
"name": "Anaconda PowerShell Prompt",
"startingDirectory": "%USERPROFILE%"
}
@synesthesia
synesthesia / friday.py
Created October 23, 2024 06:01
Python - Generate a list of Fridays starting at the start of current fiscal year
"""
Generate a list of Fridays starting at the start of current fiscal year
"""
from datetime import date
from fiscalyear import FiscalDate, FiscalYear, setup_fiscal_calendar
from dateutil.relativedelta import *
setup_fiscal_calendar(start_month=9)
f = FiscalDate.today()
current_fiscal_year = FiscalYear.current()
@synesthesia
synesthesia / split.py
Last active October 9, 2024 10:19
Splitting audio files with python and transcribing with OpenAI
"""
This module splits an audio file into multiple segments based on maximum segment length
The default maximum segment length is 15 minutes.
Output format is m4a
Usage: `python split.py <path_to_audio_file>`
Your environment must meet the following requirements:
@synesthesia
synesthesia / Get-DynamicsMetadata.ps1
Created March 8, 2024 12:41
Download Dataverse REST API metadata
$environmentUrl = 'https://yourtenant.crmX.dynamics.com/' # change this
$writeFileTo = 'C:\temp\dynamics-metadata.xml' # change this
$azTenantId = "Insert your AD tenant ID (GUID)" #change this
## Login if not already logged in
if ($null -eq (Get-AzTenant -ErrorAction SilentlyContinue)) {
Connect-AzAccount -TenantId $azTenantId| Out-Null
}
# Get an access token
$token = (Get-AzAccessToken -ResourceUrl $environmentUrl).Token
@synesthesia
synesthesia / keybase.md
Created July 14, 2022 10:49
keybase.md

Keybase proof

I hereby claim:

  • I am synesthesia on github.
  • I am synesthesiauk (https://keybase.io/synesthesiauk) on keybase.
  • I have a public key ASCeG2yBZtz4pWo3egHwhVFDyyd0PEP-1yUqn3LJUYTMqwo

To claim this, I am signing this object:

@synesthesia
synesthesia / query-ai-net.ipynb
Created May 21, 2021 10:40
Notebook: query Application Insights using C# / .Net Interactive
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@synesthesia
synesthesia / local-antora-playbook.yml
Last active September 3, 2020 14:16
Antora - Example of local author mode playbook
site:
title: My supe documentation site
start_page: sample::index.adoc
content:
sources:
- url: ./workspace/mycontentproject
branches: HEAD
start_path: docs
ui:
bundle:
@synesthesia
synesthesia / gulpfile.js
Created September 3, 2020 13:58
Gulp script to run local antora authoring preview
// see https://gitlab.com/antora/demo/docs-site/blob/watch-mode/gulpfile.js
// see https://gitlab.com/antora/antora/-/issues/329
'use strict'
const connect = require('gulp-connect')
const fs = require('fs')
//const generator = require('@antora/site-generator-default')
const generator = require('antora-site-generator-lunr')
process.env['DOCSEARCH_ENABLED'] = true
process.env['DOCSEARCH_ENGINE'] = 'lunr'
@synesthesia
synesthesia / netlify.toml
Created September 3, 2020 11:38
Netlify config to publish Antora project
# Note you must also set the following environment varibables in the Netlify UI:
# GITHUB_CREDENTIALS - a credential that can access private source repos linked from this publishing repo
# See https://docs.antora.org/antora/2.3/playbook/private-repository-auth/#pass-credentials-via-an-environment-variable
# Settings in the [build] context are global and are applied to all contexts
# unless otherwise overridden by more specific contexts.
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
@synesthesia
synesthesia / build-site.sh
Created September 3, 2020 11:34
Shell script to build antora site
DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr NODE_PATH="$(npm -g root)" antora --fetch --generator antora-site-generator-lunr antora-playbook.yml