This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A script to convert EPUB files to CBZ | |
# (for the specific case of an EPUB with image files following a specific pattern) | |
# (written with some help from ChatGPT) | |
# Check if the EPUB file path is provided as a command-line argument | |
if ($args.Count -eq 0) { | |
Write-Host "Usage: .\epub2cbz.ps1 <path-to-epub-file>" -ForegroundColor Yellow | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// old way: | |
public async Task RunAsync() | |
{ | |
CallContext context = new CallContext(); | |
context.Company = "axcompany"; | |
string pingResp = string.Empty; | |
var client = new XYZPurchInfoServiceClient(); | |
var rv = await client.wsPingAsync(context); | |
pingResp = rv.response; | |
Console.WriteLine("Ping response: {0}", pingResp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get-auth-hdr-0.ps1 | |
# Get the auth hdr and send it to the clipboard. | |
# ajh 2022-08-29: rewrite to use MSAL.PS. | |
# ajh 2022-11-23: read secret from env vars. | |
#Requires -Version 5.1 | |
#Requires -Modules @{ ModuleName="MSAL.PS"; ModuleVersion="4.0" } | |
# force TLS 1.2 | |
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get-auth-hdr-1.ps1 | |
# Get the auth hdr and send it to the clipboard. | |
# ajh 2023-04-06: new. | |
#Requires -Version 7 | |
#Requires -Modules @{ ModuleName="MSAL.PS"; ModuleVersion="4.0" } | |
# force TLS 1.2 | |
$TLS12Protocol = [System.Net.SecurityProtocolType] 'Tls12' | |
[System.Net.ServicePointManager]::SecurityProtocol = $TLS12Protocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void deleteAllFromList(ClientContext cc, List myList) | |
{ | |
int queryLimit = 4000; | |
int batchLimit = 100; | |
bool moreItems = true; | |
string viewXml = string.Format(@" | |
<View> | |
<Query><Where></Where></Query> | |
<ViewFields> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- originally taken from http://phydeaux3.blogspot.com/2007/05/automatic-list-of-labels-for-classic.html --> | |
<div id="labelList" class="BlogBody"></div> <script type="text/javascript"> | |
//<![CDATA[ | |
function listLabels(root){ | |
var baseURL = '/search/label/'; | |
var baseHeading = "My Tags"; | |
var isFTP = false; | |
var llDiv = document.getElementById('labelList'); | |
var entry = root.entry; | |
var h1 = document.createElement('h1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sample C# code to create a lead with the Zoho CRM API. | |
* ajh 2012-08-23 | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Dynamic; | |
using System.Linq; | |
using System.Net; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enables TLS 1.2 on Windows Server 2008 R2 and Windows 7 | |
# adapted from https://www.derekseaman.com/2010/06/enable-tls-12-aes-256-and-sha-256-in.html | |
# Must run as admin. Reboot after running. | |
$tls12key = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2" | |
if (Test-Path $tls12key) { | |
Write-Host "TLS 1.2 key already exists." | |
exit | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Code/Mandrill.cs | |
* These are calls to the Mandrill email service. | |
* Reference: https://mandrillapp.com/api/docs/ | |
* | |
* ajh 2012-08-09: new | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool doesVendorRecExist(string companyCode, string vendorNum, | |
List vendorList, ClientContext cc) | |
{ | |
CamlQuery spq = new CamlQuery(); | |
spq.ViewXml = string.Format(@" | |
<View><Query> | |
<Where><And> | |
<Eq><FieldRef Name='VendorNo' /><Value Type='Text'>{0}</Value></Eq> | |
<Eq><FieldRef Name='CompanyName' /><Value Type='Text'>{1}</Value></Eq> | |
</And></Where> |
NewerOlder