Skip to content

Instantly share code, notes, and snippets.

View Kreijstal's full-sized avatar
↗️

Kreijstal Kreijstal

↗️
View GitHub Profile
@ochafik
ochafik / get_ollama_gguf.js
Last active March 30, 2025 22:10
Script to get the GGUF file from an Ollama image for use with llama.cpp's llama-server
#!/usr/bin/env node
/*
Gets the file under $OLLAMA_HOME/models/blobs/ for the application/vnd.ollama.image.model key in the manifest
- Note that metadata of modelId:modelTag is stored under $OLLAMA_HOME/models/manifests/registry.ollama.ai/library/${modelId}/${modelTag}
- You'll need to get the Jinja template from the original model using llama.cpp's scripts/get_chat_template.py script
ollama pull qwen2.5-coder:7b
llama-server -m $( ./get_ollama_gguf.js qwen2.5-coder:7b ) -fa --jinja --chat-template-file <( ./scripts/get_chat_template.py Qwen/Qwen2.5-Coder-7B-Instruct-GGUF tool_use )
Initially shared here: https://github.com/ggml-org/llama.cpp/pull/9639#issuecomment-2704208342
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active April 5, 2025 04:14
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@NickNaso
NickNaso / binding.gyp
Created April 27, 2020 13:46
N-API register module (the new way)
{
"targets": [
{
"target_name": "hello",
"sources": [ "hello.cc" ]
}
]
}
@Locoxella
Locoxella / mingw-sshd.sh
Last active September 26, 2024 06:45
Enable sshd on MinGW
#!/bin/bash
#
# Configure sshd on MinGW for Windows
# Create host keys
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa
ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
@sbz
sbz / tty-size.py
Last active March 28, 2025 06:58
get terminal size using ioctl get win size (TIOCGWINSZ) in Python
import termios
import fcntl
import os
import struct
with open(os.ctermid(), 'r') as fd:
packed = fcntl.ioctl(fd, termios.TIOCGWINSZ, struct.pack('HHHH', 0, 0, 0, 0))
rows, cols, h_pixels, v_pixels = struct.unpack('HHHH', packed)
print rows, cols, h_pixels, v_pixels
@techedlaksh
techedlaksh / mat_to_csv.py
Created March 21, 2017 23:07
Converting mat files to csv using python, scipy and pandas
import scipy.io
import pandas as pd
mat = scipy.io.loadmat('file.mat')
mat = {k:v for k, v in mat.items() if k[0] != '_'}
data = pd.DataFrame({k: pd.Series(v[0]) for k, v in mat.iteritems()})
data.to_csv("example.csv")
@arendu-zz
arendu-zz / install_stuff.sh
Last active July 27, 2016 18:59
install stuff on aws
sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install default-jdk
@strezh
strezh / QuestaSimNotes.md
Last active June 30, 2024 06:44
QuestaSim notes

Установка под Linux

При установке под линукс (проверено на Ubuntu 16):

  1. Устанавливаем wine
  2. Из папки crack копируем файл MentorKG.exe в <install_dir>/linux (или /linux_x86_64)
  3. Выполняем
sudo chown root:root ~/.wine
@tejainece
tejainece / configure_modelsim.sh
Last active June 30, 2024 06:42
This script installs all the 32 bit library dependencies of modelsim and also compiles freetype.
#!/bin/bash
ALTERA_PATH=~/altera/13.1/
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib \
lib32z1 lib32stdc++6 lib32gcc1 \
expat:i386 fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 libgtk-3-0:i386 \
libcanberra0:i386 libpng12-0:i386 libice6:i386 libsm6:i386 libncurses5:i386 zlib1g:i386 \
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.