Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Srushtika / server.js
Last active October 14, 2021 11:21
WebSockets server tutorial
const http = require('http');
const crypto = require('crypto');
const static = require('node-static');
const file = new static.Server('./');
const server = http.createServer((req, res) => {
req.addListener('end', () => file.serve(req, res)).resume();
});
server.on('upgrade', function (req, socket) {
if (req.headers['upgrade'] !== 'websocket') {
socket.end('HTTP/1.1 400 Bad Request');
@buzz
buzz / convert.py
Last active June 10, 2026 23:00
Transplant MTP block from one GGUF file into another
#!/usr/bin/env python3
"""
Transplant extra tensors (e.g. MTP layers) from one GGUF file into another,
producing a mixed-quantization GGUF.
Note: Tested with ik_llama.cpp GGUF Python module.
Usage:
python convert.py <target.gguf> <source.gguf> <output.gguf>