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
# Required packages: | |
# pip install SpeechRecognition mlx-whisper pyaudio | |
# Note: This script requires Apple Silicon Mac for MLX Whisper | |
import speech_recognition as sr | |
import numpy as np | |
import mlx_whisper | |
r = sr.Recognizer() | |
mic = sr.Microphone(sample_rate=16000) |
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 more information, see the Configuration Guide: | |
# https://docs.librechat.ai/install/configuration/custom_config.html | |
# Configuration version (required) | |
version: 1.0.6 | |
# Cache settings: Set to true to enable caching | |
cache: true | |
# Custom nterface configuration |
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 json | |
import os | |
import ollama | |
def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''): | |
response = ollama.generate( | |
model=model, | |
prompt=context + prompt) | |
return response['response'].strip() |
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
{ | |
"last_node_id": 25, | |
"last_link_id": 43, | |
"nodes": [ | |
{ | |
"id": 14, | |
"type": "VideoLinearCFGGuidance", | |
"pos": [ | |
487.799932861328, | |
265.6999450683599 |
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
#!/bin/sh | |
# | |
# /etc/init.d/kibana4_init -- startup script for kibana4 | |
# [email protected] 2015-02-20; used elasticsearch init script as template | |
# https://github.com/akabdog/scripts/edit/master/kibana4_init | |
# | |
### BEGIN INIT INFO | |
# Provides: kibana4 | |
# Required-Start: $network $remote_fs $named | |
# Required-Stop: $network $remote_fs $named |
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
angular.module('d3', []) | |
.factory('d3Service', ['$document', '$window', '$q', '$rootScope', | |
function($document, $window, $q, $rootScope) { | |
var d = $q.defer(), | |
d3service = { | |
d3: function() { return d.promise; } | |
}; | |
function onScriptLoad() { | |
// Load client in the browser | |
$rootScope.$apply(function() { d.resolve($window.d3); }); |
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
MongoDB, c#: Case insensitive search | |
Query.Matches("FirstName", BsonRegularExpression.Create(new Regex(searchKey,RegexOptions.IgnoreCase))); | |
Query.Matches("FieldName", BsonRegularExpression.Create(new Regex(searchKey, RegexOptions.IgnoreCase))) | |
public User FindByEmail(Email email) | |
{ | |
return session.GetCollection<User>().AsQueryable() | |
.Where(u => u.EmailAddress.ToLower() == email.Address.ToLower()).FirstOrDefault(); | |
} |
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 ubuntu | |
MAINTAINER ivanfioravanti "[email protected]" | |
# Java 7 | |
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 | |
RUN apt-get update | |
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections | |
RUN apt-get install oracle-java7-installer -y | |
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
Mapper.CreateMap<List<ObjectId>, List<string>>().ConvertUsing(o => o.Select(os => os.ToString()).ToList()); | |
Mapper.CreateMap<List<string>, List<ObjectId>>().ConvertUsing(o => o.Select(os => ObjectId.Parse(os)).ToList()); | |
Mapper.CreateMap<ObjectId, string>().ConvertUsing(o => o.ToString()); | |
Mapper.CreateMap<string, ObjectId>().ConvertUsing(s => ObjectId.Parse(s)); |
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
@Component | |
class PaginatedResultsRetrievedEventDiscoverabilityListener implements ApplicationListener< PaginatedResultsRetrievedEvent >{ | |
@Override | |
public void onApplicationEvent( PaginatedResultsRetrievedEvent ev ){ | |
Preconditions.checkNotNull( ev ); | |
this.addLinkHeaderOnPagedResourceRetrieval( | |
ev.getUriBuilder(), ev.getResponse(), ev.getClazz(), ev.getPage(), ev.getTotalPages(), ev.getPageSize() ); | |
} | |
void addLinkHeaderOnPagedResourceRetrieval( UriComponentsBuilder uriBuilder, HttpServletResponse response, |
NewerOlder