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
import pandas as pd | |
import openpyxl | |
#https://foss.heptapod.net/openpyxl/openpyxl | |
#from openpyxl.xml.constants import (ARC_SHARED_STRINGS, SHARED_STRINGS, ARC_CONTENT_TYPES, CONTYPES_NS) | |
#https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/3.1/openpyxl/xml/constants.py#L35 | |
#openpyxl.xml.constants.ARC_SHARED_STRINGS = openpyxl.xml.constants.PACKAGE_XL + '/SharedStrings.xml' | |
#from openpyxl.reader.strings import read_string_table, read_rich_text |
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
using System.Runtime.CompilerServices; | |
using Microsoft.SemanticKernel.Memory; | |
using Algolia.Search.Clients; | |
using Algolia.Search.Models.Search; | |
using System.Text.Json; | |
public class AlgoliaMemory : ISemanticTextMemory | |
{ | |
private readonly ISearchClient _searchClient; |
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://stackoverflow.com/questions/76106284/how-to-return-chunked-text-plain-content-from-web-api-using-minimal-api | |
//https://github.com/dotnet/aspnetcore/tree/main/src/Http/Http.Results | |
public class AsyncEnumerableStringsResult : IResult, IContentTypeHttpResult, IStatusCodeHttpResult | |
{ | |
protected readonly IAsyncEnumerable<string> chunks; | |
public string? ContentType => "text/plain; charset=utf-8"; | |
public int StatusCode => StatusCodes.Status200OK; |
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
using System.ComponentModel; | |
using System.Text; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.SemanticKernel; | |
using Microsoft.SemanticKernel.Orchestration; | |
using Microsoft.SemanticKernel.SkillDefinition; | |
using Microsoft.SemanticKernel.AI.ChatCompletion; | |
using Microsoft.SemanticKernel.Memory; | |
class ConversationalRetrievalPlugin |
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
"use strict"; | |
var FORMULA_DISABLED_PREFIX = '?'; | |
var FORMULA_DISABLED_FULL_PREFIX = '=' + FORMULA_DISABLED_PREFIX; | |
//https://support.geckoboard.com/hc/en-us/articles/206260188 | |
function ForceRecalculateActiveSheet() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
ForceRecalculateSheet(sheet); | |
} |
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
<?php | |
//https://codex.wordpress.org/Function_Reference/shortcode_atts | |
$args = shortcode_atts( | |
array( | |
'text' => '', | |
'domain' => 'default', | |
), $atts, 'translate__'); | |
//https://developer.wordpress.org/reference/functions/__/ | |
return __($args['text'], $args['domain']); |
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
<?php | |
function do_shortcode_title($title) { | |
return do_shortcode($title); | |
} | |
add_filter('the_title', 'do_shortcode_title'); | |
add_filter('single_post_title', 'do_shortcode_title'); |
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
<?php | |
function set_locale($lang) { | |
define('LANG_PARAM', 'lang'); | |
$req_lang = $lang; | |
if(!isset($_SESSION)) | |
session_start(); | |
if(isset($_REQUEST[LANG_PARAM])) { |
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
<?php | |
//https://github.com/woocommerce/woocommerce-google-analytics-integration/blob/master/includes/class-wc-google-analytics-js.php | |
function woocommerce_ga_snippet_output_userid($code) { | |
$user_id = get_current_user_id(); | |
if($user_id > 0) { | |
$ga_user_id = WC_Google_Analytics_JS::tracker_var() . "('set', 'userId', '" . $user_id . "');"; | |
$code = $code . $ga_user_id; | |
} | |
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
<?php | |
//https://codex.wordpress.org/Plugin_API/Action_Reference/rss2_item | |
//https://validator.w3.org/feed/ | |
function add_rss_featured_image() { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$thumbnail_id = get_post_thumbnail_id($post->ID); | |
$thumbnail = wp_get_attachment_image_src($thumbnail_id, 'large'); |
NewerOlder