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
// https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Routes/#tag/Routes/operation/post-v3-routes | |
// This sample works with .net framework | |
private static async Task<Route> CreateRoute(string recipientAddress, string forwardAddress) | |
{ | |
RestClientOptions options = new RestClientOptions(new Uri("https://api.mailgun.net/v3")); | |
options.Authenticator = new HttpBasicAuthenticator("api", ApiKey); | |
using (RestClient client = new RestClient(options)) | |
{ | |
//Url encoded format, example: https://example.com/api?priority=0&description=it%27s+a+new+route&expression=match_recipient%28%22user%40example.com%22%29&action=%5B%27forward%28%22forward%40example.com%22%29%27%5D |
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
# Example from Mailgun: https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Routes/#tag/Routes/operation/post-v3-routes | |
import requests | |
url = "https://api.mailgun.net/v3/routes" | |
data = { | |
"priority": "0", | |
"description": "it's a new route", | |
"expression": "match_recipient('.*@gmail.com')", | |
"action[0]": "forward("http://myhost.com/messages/")" |
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
Dictionary < string, string > responseFormat = new Dictionary < string, string > { | |
{ | |
"type", | |
"json_object" | |
} | |
}; | |
var payload = new { | |
model = "gpt-4o-mini", | |
messages = messages, | |
max_tokens = 300, |
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
async def handle_transcript_event(self, transcript_event: TranscriptEvent): | |
# This handler can be implemented to handle transcriptions as needed. | |
# Here's an example to get started. | |
results = transcript_event.transcript.results | |
for result in results: | |
if not result.is_partial: | |
for alt in result.alternatives: | |
print(alt.transcript) |
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
# Load WPF assemblies | |
Add-Type -AssemblyName PresentationFramework | |
# Define XAML code for the GUI | |
[xml]$xaml = @" | |
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="Celsius to Fahrenheit Converter" Height="250" Width="400"> | |
<Grid> | |
<Label Content="Celsius:" HorizontalAlignment="Center" Margin="0,40,0,0" VerticalAlignment="Top" FontSize="16" FontWeight="SemiBold"/> |
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
const appId = 'sq0idp-yCB3jRpR0PbPfffcFBEVbA'; | |
const locationId = 'LGB4QKD1ME9BE'; | |
const username = 'xxxx'; | |
const amount = '500'; | |
const partyId = 'xx'; | |
const winningBidderId = 'xxxx'; | |
const auctionGroupId = 'xxxx'; | |
async function initializeCard(payments) { | |
const card = await payments.card(); |
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
from square.client import Client | |
import os | |
import uuid | |
environment='production' | |
idempotency_key = str(uuid.uuid4()) | |
# Returns Error: [{'category': 'INVALID_REQUEST_ERROR', 'code': 'INVALID_EMAIL_ADDRESS', 'detail': "This account's email is linked to a current Weebly Account."}] |
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
// For https://wol.jw.org/ms Bible reading in Edge browser using text to speech. This will allow the browser to read the text without the verse numbers being read. | |
// Add chapter to chapter number | |
var elements = document.querySelectorAll('.cl'); | |
element = elements[0] | |
var chapterNumber = element.innerText.trim() | |
element.innerText = `Pasal ${chapterNumber}: ` | |
// Turn off reference symbols. | |
elements = document.querySelectorAll('.toggle'); |
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
var uppy = new Uppy.Core({ | |
autoProceed: true, | |
restrictions: { | |
allowedFileTypes: ['image/*'] | |
}, | |
onBeforeFileAdded: (currentFile, files) => { | |
// Change the file name to the last modified date. This file name doesn't arrive at the server upload handler. | |
const modifiedFile = { | |
...currentFile, | |
name: currentFile.data.lastModified + ".jpg" |
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
var client = new HttpClient(); | |
// Heartbeat URL | |
const string url = "https://heartbeat.uptimerobot.com/YOUR CODE HERE"; | |
// Get the response. | |
HttpResponseMessage response = await client.GetAsync(url); | |
Console.WriteLine(response.StatusCode); |