Skip to content

Instantly share code, notes, and snippets.

import llama_cpp
import re
import json
# Model configuration
# tested with mistral, llama2, llama3, and phi3
model_path = "/path/to/model"
base_llm = llama_cpp.Llama(model_path, seed=42, n_gpu_layers=-1, n_ctx=4096, verbose=False, temperature=0.0)
@kharrison
kharrison / SwiftIntegerGuide.swift
Created February 17, 2017 16:43
Swift Integer Quick Guide
// -------------------------------------
// Swift Integer Quick Guide
// -------------------------------------
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
@tigerhawkvok
tigerhawkvok / poetry-convert.py
Last active May 6, 2024 06:18
Convert a requirements.txt file to a Poetry project
#!python3
"""
Convert a requirements.txt file to a Poetry project.
Just place in the root of your working directory and run!
"""
sourceFile = "./requirements.txt"
import re
import os
@wojteklu
wojteklu / clean_code.md
Last active May 6, 2024 06:18
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@m5lil
m5lil / reset.sh
Last active May 6, 2024 06:16
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@bscott
bscott / devshell.nix
Last active May 6, 2024 06:14
Nix Dev Shell Setup
{ pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set
}:
pkgs.mkShell { # mkShell is a helper function
name="dev-environment"; # that requires a name
buildInputs = [ # and a list of packages
pkgs.nodejs
pkgs.python3
pkgs.go
pkgs.rustc
pkgs.wget
@agrlh
agrlh / install_netatalk_debian.md
Last active May 6, 2024 06:13
Compiling and installing netatalk 3.1.2 on Debian (used for my RaspberryPi TimeCapsule)

Building and setting up netatalk 3.1.2 on Debian

1. Build

Install dependencies

sudo apt-get install automake libtool build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libssl-dev libdb5.1-dev db-util db5.1-util libgcrypt11 libgcrypt11-dev libcrack2-dev libpam0g-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libwrap0-dev systemtap-sdt-dev libacl1-dev libldap2-dev

Download and unpack netatalk 3.1.2

@ericakfranz
ericakfranz / envira-gallery-remove-media-button.php
Created September 3, 2017 04:09
Remove the Add Gallery button on post / page edit screen.
@rain1024
rain1024 / tut.md
Last active May 6, 2024 06:12
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.
@geovannimp
geovannimp / cSpell_packageJson_dictionary.md
Last active May 6, 2024 06:11
cSpell package.json dictionary

cSpell package.json dictionary with monorepo support

Create the following files in the .vscode folder of your repo

.vscode/cspell.json

{
  "import": ["./cspell-node.config.cjs"]
}

.vscode/cspell-node.config.cjs