Skip to content

Instantly share code, notes, and snippets.

@vickybiswas
vickybiswas / rag-reranking-gpt-colbert.ipynb
Created January 22, 2024 07:54 — forked from virattt/rag-reranking-gpt-colbert.ipynb
rag-reranking-gpt-colBERT.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"Customer":{
"Name":"",
"Phone":"",
"Email":"",
"Agreement":{
"_relation":1,
"Machine":{
"_relation":1,
"MSN":"",
@vickybiswas
vickybiswas / Add to Common Functions
Created December 5, 2012 01:14
Fix for broken menu_order
function pmc_gallery_menu_order_fix($id) {
$regex_pattern = get_shortcode_regex();
preg_match ('/'.$regex_pattern.'/s', stripslashes($_POST['content']), $regex_matches);
if ($regex_matches[2] == 'gallery') :
$attribureStr = str_replace (" ", "&", trim ($regex_matches[3]));
$attribureStr = str_replace ('"', '', $attribureStr);
$attributes = wp_parse_args ($attribureStr);
endif;
$ids = explode(',', $attributes[ids]);
$images = get_posts( array(
@vickybiswas
vickybiswas / addtofunction.php
Created July 13, 2012 03:34
Convert Caption in Attachments to a RTE
function vicky($form_fields) {
preg_match('/name="([^"]*)/', $form_fields["post_excerpt"]["html"], $matches);
$args = array("textarea_name" => $matches[1], "media_buttons" => false, 'quicktags' => true, 'textarea_rows' => '5');
preg_match('/>(.*)</', $form_fields["post_excerpt"]["html"], $matches);
ob_start();
wp_editor( html_entity_decode($matches[1]), "wpet_options[textarea_one]", $args );
$html = ob_get_clean();
$form_fields["post_excerpt"]["input"] = "html";
$form_fields["post_excerpt"]["html"] = $html;