Skip to content

Instantly share code, notes, and snippets.

@darkseed
darkseed / hls.sh
Created November 9, 2024 18:49 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
import os
from pathlib import Path
import logging
import argparse
from concurrent.futures import ThreadPoolExecutor, as_completed
import pathspec
from collections import defaultdict
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@darkseed
darkseed / llama-index_starter_dbrx.py
Created April 10, 2024 07:25 — forked from dennyglee/llama-index_starter_dbrx.py
Llama_Index Starter Example using DBRX
#
# LlamaIndex Starter Example with DBRX
#
# Based on the LlamaIndex Starter Example
# https://docs.llamaindex.ai/en/stable/getting_started/starter_example/
#
# Ensure you have installed both llama_index and Databricks integration
# e.g., pip install llama_index llama-index-llms-databricks
#
@darkseed
darkseed / dispatch_openai_requests.py
Created April 23, 2023 19:00 — forked from neubig/dispatch_openai_requests.py
A simple script to get results from the OpenAI Asynchronous API
import openai
import asyncio
from typing import Any
async def dispatch_openai_requests(
messages_list: list[list[dict[str,Any]]],
model: str,
temperature: float,
max_tokens: int,
top_p: float,
@darkseed
darkseed / readme.md
Created November 24, 2021 15:08 — forked from ChipCE/readme.md
Klipper bed mesh on print area only macro install guide

Klipper mesh on print area only install guide

What this macro do

  • This macro will dymanic change the bed_mesh area based on the size of the printed part. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)

Setup guide

  • (1) Add the following macrro to your printer config, this will replace the default BED_MESH_CALIBRATE command.
# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""
@darkseed
darkseed / brnn.py
Created December 5, 2017 15:40 — forked from allenanie/brnn.py
Bayesian Recurrent Neural Network Implementation
"""
An implementation of the `Local reparameterization trick`
from Kingma & Wellings and
Bayesian RNN
from Fortunato, Blundell & Vinyals
"""
import os
import time
import copy
from os.path import join as pjoin
@darkseed
darkseed / README.rst
Created August 15, 2017 13:17 — forked from honzakral/README.rst
CLI for elaasticsearch-py helpers

Elasticsearch CLI

Experimental CLI interface for the helpers in the `python library`_.

Main purpose is to expose the bulk functionality to enable rapid loading of data into an elasticsearch cluster. Combined with the scan command it can also be used to reindex data from elasticsearch into a different index or cluster.

@darkseed
darkseed / schools.stan
Created August 9, 2017 15:02 — forked from strongh/schools.stan
toy example of MCMC using (py)stan and (py)spark
data {
int<lower=0> J; // number of schools
real y[J]; // estimated treatment effects
real<lower=0> sigma[J]; // s.e. of effect estimates
}
parameters {
real mu;
real<lower=0> tau;
real eta[J];
}