Skip to content

Instantly share code, notes, and snippets.

@imweijh
imweijh / demo.rb
Created May 24, 2024 14:01 — forked from lukeholder/demo.rb
How to connect to Microsoft SQL Server with jruby on Windows using JDBC and Sequel Gem
require "java"
require "rubygems"
require "sequel"
require "sqljdbc4.jar" #this files path may need to be relevate to file location
DB = Sequel.connect(
:adapter => "jdbc",
:url => "jdbc:sqlserver://doric-server5;database=ADCData_Doric;integratedSecurity=true"
# This is using integrated security, might want to pass username and password
# More Info at http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
@imweijh
imweijh / add_index_to_all_dirs.sh
Created July 29, 2024 06:12 — forked from corysolovewicz/add_index_to_all_dirs.sh
Recursively create an empty index.html file in all directories which currently do not have one.
# run this command in the root web directory
find . -type d -exec touch {}/index.html \;
@imweijh
imweijh / install_pyenv.md
Created August 7, 2024 02:06 — forked from trongnghia203/install_pyenv.md
Install pyenv
@imweijh
imweijh / README.md
Created December 25, 2024 14:21 — forked from liviaerxin/README.md
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@imweijh
imweijh / .gitconfig
Created March 12, 2025 00:30 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "[email protected]:"]
insteadOf = git://github
FROM qwen3:30b-a3b-q8_0
TEMPLATE """{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
@imweijh
imweijh / README.md
Created May 23, 2025 01:51 — forked from Artefact2/README.md
GGUF quantizations overview
@imweijh
imweijh / cc-proxy.sh
Created August 1, 2025 06:10 — forked from olafgeibig/cc-proxy.sh
A LiteLLM proxy solution to use Claude Code with models from the Weights and Biases inference service. You need to have LiteLLM installed or use the docker container. Easiest is to install it with `uv tool install "litellm[proxy]"` Don't worry about the fallback warnings. Either LiteLLM, W&B or the combo of both are not handling streaming respon…
#!/bin/bash
export WANDB_API_KEY=<your key>
export WANDB_PROJECT=<org/project>
litellm --port 4000 --debug --config cc-proxy.yaml