Skip to content

Instantly share code, notes, and snippets.

@nathggns
nathggns / README.md
Last active May 12, 2024 01:26
Fibonacci Generator in LMC

LMC Fibonacci Generator

Screenshot

You can run this program on any LMC emulator, such as http://peterhigginson.co.uk/LMC/

LMC, which stands for Little Man Computer is a model of a computer, used to teach students how CPUs work. Read More.

Lines 1-2

@Artefact2
Artefact2 / README.md
Last active May 12, 2024 01:25
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@panamantis
panamantis / logging.ini
Created June 20, 2020 13:22
Python logging configuration files (yaml, json, ini)
[loggers]
keys=root,app,uvicorn
[handlers]
keys=console,file,uvicorn
[formatters]
keys=console,file
[logger_root]
@ssstonebraker
ssstonebraker / sed cheatsheet
Created August 2, 2013 14:06 — forked from un33k/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@lincolnthalles
lincolnthalles / random_memo.js
Last active May 12, 2024 01:19
Add "Random Memo" button to Memos v0.21+ sidebar
const RANDOM_MEMO_SETTINGS = {
// Amount of memos to cache
memoAmount: 100,
// Kinds of memos to cache: PUBLIC = visible to everyone, PROTECTED = logged in users, PRIVATE = only the creator
memoKinds: ["PUBLIC", "PROTECTED", "PRIVATE"],
// Time in minutes to cache the memos
memoCacheTimeMinutes: 60,
// Username of the memo creator to filter the memos
memoCreatorUsername: "",
// Button text
@Gavinok
Gavinok / eglot-codelens.el
Created March 12, 2024 22:10
Add support for code lenses in eglot for emacs
;; eglot-codelens.el --- Add support for codelenses to eglot -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
;;; Extending eglot to support lenses
;;;; Findings
;; Lenses often support the option to be used as a code action
;; some servers rely on custom code actions implemented by the client
;; - [[https://github.com/emacs-lsp/lsp-mode/issues/2250]] mentions this
@philippkraft
philippkraft / README.md
Last active May 12, 2024 01:16
Convert xyz elevation models to GeoTiff

Convert .xyz elevation models to GeoTiff

In Germany, more and more state agencies allow free access to high resolution elevation models. However, these are often released as xyz tables, which are not easily used in GIS environments. A standard method to convert this format to raster formats (eg. GeoTiff) is the GDAL function gdal_translate [1, 2]. However, converting 1M lines takes dozens of seconds and is not trivial to parallize.

@pknowledge
pknowledge / Find_and_Draw_Contours_using_OpenCV_Python.py
Created June 19, 2019 16:38
OpenCV Python Tutorial For Beginners - Find and Draw Contours with OpenCV in Python
import numpy as np
import cv2
img = cv2.imread('baseball.png')
imgray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret, thresh = cv2.threshold(imgray, 127, 255, 0)
contours, hierarchy = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)
print("Number of contours = " + str(len(contours)))
print(contours[0])
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 12, 2024 01:14
Free backend hosting
@korakot
korakot / record.py
Last active May 12, 2024 01:14
Record audio in Colab using getUserMedia({ audio: true })
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))