Skip to content

Instantly share code, notes, and snippets.

@mausch
mausch / flake.nix
Created April 14, 2023 10:21
Llama.cpp + Alpaca-30B
{
description = "llama.cpp running Alpaca-30B";
inputs = {
llama.url = "github:ggerganov/llama.cpp/aaf3b23debc1fe1a06733c8c6468fb84233cc44f";
flake-utils.url = "github:numtide/flake-utils/033b9f258ca96a10e543d4442071f614dc3f8412";
nixpkgs.url = "github:NixOS/nixpkgs/d9f759f2ea8d265d974a6e1259bd510ac5844c5d";
};
outputs = { self, flake-utils, llama, nixpkgs }:
@mausch
mausch / flake.nix
Last active April 21, 2024 15:57
llama-vicuna.nix
{
description = "llama.cpp running vicuna";
inputs = {
llama.url = "github:ggerganov/llama.cpp/aaf3b23debc1fe1a06733c8c6468fb84233cc44f";
flake-utils.url = "github:numtide/flake-utils/033b9f258ca96a10e543d4442071f614dc3f8412";
nixpkgs.url = "github:NixOS/nixpkgs/d9f759f2ea8d265d974a6e1259bd510ac5844c5d";
};
outputs = { self, flake-utils, llama, nixpkgs }:
@inscapist
inscapist / flake-direnv.md
Last active December 13, 2023 00:05
Nix Flakes and Direnv on Mac OSX (Catalina)

Development environment with Nix Flakes and Direnv

This document is targeted at those who seek to build reproducible dev environment across machines, OS, and time.

It maybe easier for remote teams to work together and not spending hours each person setting up asdf/pyenv/rbenv, LSP servers, linters, runtime/libs. Nix is probably the closest thing to Docker in terms of development environment.

Flake is used here because it provides hermetic build, with absolutely no reliance on system environment (be it Arch/Catalina/Mojave). Also it freezes dependencies in flake.lock so builds are reproducible.

This gist provides the setup to develop Java/Clojure/Python applications on Nix. But it can be easily adapted to ruby, nodejs, haskell.

@nijave
nijave / gigabyte-x470-gaming-7-sensors.sh
Last active April 7, 2024 10:27
Setup sensors for Gigabyte X470 Gaming 7 w/ Fedora
#!/bin/sh
# The chip info can be found via sensors-detect in lm_sensors
# Driver `to-be-written':
# * ISA bus, address 0xa40
# Chip `ITE IT8686E Super IO Sensors' (confidence: 9)
# Driver `it87':
# * ISA bus, address 0xa60
# Chip `ITE IT8792E Super IO Sensors' (confidence: 9)
@xi
xi / dbusmenu.py
Last active November 3, 2023 18:00
dmenu wrapper around dbus menues
# dmenu wrapper around dbus menues
#
# Example Usage:
# python3 dbusmenu.py org.freedesktop.network-manager-applet /org/ayatana/NotificationItem/nm_applet/Menu
#
# https://github.com/tetzank/qmenu_hud/blob/master/com.canonical.dbusmenu.xml
import subprocess
import sys
import time
@cmetz
cmetz / nebula_usb.py
Created December 14, 2020 11:02
Python Durgod K320 Nebula Hacks
import usb.core
import usb.util
import array
import time
import random
import math
import webcolors
import random
from collections import OrderedDict, namedtuple
from sys import exit
@JesseBuesking
JesseBuesking / pprint_defaulttict.py
Created March 17, 2014 17:51
Pretty prints a default dict in IPython
def pprint_defaultdict():
from collections import defaultdict
import IPython
ip = get_ipython()
tf = ip.display_formatter.formatters['text/plain']
def _print_default_dict(arg, p, cycle):
""" Pretty print a defaultdict. """
def rec(obj, indent=0, level=0):
if isinstance(obj, defaultdict) or isinstance(obj, dict):
p.text('{\n')
@ckirkendall
ckirkendall / clojure-match.clj
Created June 15, 2012 02:26 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})