Skip to content

Instantly share code, notes, and snippets.

View schartz's full-sized avatar
🕸️
🚀 Pushing code slop to new horizons

Schartz Rehan schartz

🕸️
🚀 Pushing code slop to new horizons
View GitHub Profile
@schartz
schartz / aicommit.sh
Last active March 17, 2025 12:53
Git command line automated commit message generator which uses ollama
#!/bin/bash
RESETCOLOR='\033[0m' # Reset color
CYAN='\033[0;36m' # Cyan
RED='\033[0;31m' # Red
# Loader animation function
show_loader() {
local pid=$1
local delay=0.1

1 Increase ollama ctx window

create a text file mymodel with following content

# Modelfile
FROM <desired model name>
PARAMETER num_ctx <desired context in digits eg. 32768>

Run following command

@schartz
schartz / gist:0d72f51b03ef294f83e503c6181869f7
Last active May 9, 2024 07:03
Setup RDP server on KDE Plasma, Wayland with Arch Linux (Endeavour OS)

Uninstall any old installations of xrdp xorgxrdp

yay -Rncs xrdp-git xrdp-git-debug xorgxrdp-git xorgxrdp-git-debug

Install xrdp and xorgxrdp

yay -S xrdp xorgxrdp
eyJ4NXQiOiJVb1VIUHhzUVlvbElMUzVacU5GQjlGeXFiZnciLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJJQU0iLCJleHAiOjE2NjcwMjAyNzcsImp0aSI6IjRaNUVZREQycTRKWEhRaFplQ2VFVXciLCJpYXQiOjE1NTYwMjAyNzcsIm5iZiI6MTU1NjAyMDI3Nywic3ViIjoiMTEwNDI3OSIsImF1ZCI6IkFWQUxPUSIsImJ1aWQiOiIyIiwiY2hhbm5lbCI6IndlYiIsInBpZCI6IjIxNzk1IiwiY25vIjoiMTQ3NjgxMzAyOCIsImF2YWxvcV9idV9pZCI6IjIiLCJyb2xlcyI6WyJpYmFua2luZyIsImViYW5raW5nX3N0cm9uZyIsImViYW5raW5nX3dlYWsiLCJlYmFua2luZ193ZWFrIl19.NiHrEsk6idmx0eaUwxmtAP-UpU89apvWQGujEZp7NPozSgFx1x2sEqIfLzRf1z6FanN9mZwG4znAMKJrO-QnpFfCZyxFVkvOYVvJxqWAQdLEXOVYwJttCNWLjnHx_KnYVJeDWQrZNGn6qKn0jN1Ucn10yG1tylKgLlBgEIjWcxGgYJMIE_gs0vfB6-fYqHqOfPaOe-ZVYIWS3YA0ujAcq884qnpWowG7oEeaVy-iabx3wOG0OeimjDuJogGbib6Wt5KcxN_0RZimEqJSDb_jR-JjGDjPs3lnZpLYPxfBteJhIc1RNw_CMeobllgF6FaGDmYMjAkj6SEWDi7wDnnAzQ

Keybase proof

I hereby claim:

  • I am schartz on github.
  • I am schartz (https://keybase.io/schartz) on keybase.
  • I have a public key whose fingerprint is E391 54EE C496 5346 8616 2043 79FB 2636 CFBF B99F

To claim this, I am signing this object:

@schartz
schartz / web-servers.md
Created July 27, 2016 08:29 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@schartz
schartz / optimize.js
Created November 19, 2014 00:28
A simple optimization procedure which silently optimizes DOM manipulation actions which concievably increases the overall "execution-time performance. Just drop this script (after jQuery or Mootools, if you happen to use that). It's unobtrusive javascript. Should work nicely. Cio!!
function setEndOfContenteditable(contentEditableElement) {
var range, selection;
if (document.createRange) //Firefox, Chrome, Opera, Safari, IE 9+
{
range = document.createRange(); //Create a range (a range is a like the selection but invisible)
range.selectNodeContents(contentEditableElement); //Select the entire contents of the element with the range
range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start
selection = window.getSelection(); //get the selection object (allows you to change selection)
selection.removeAllRanges(); //remove any selections already made
selection.addRange(range); //make the range you have just created the visible selection