This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# core | |
> Fill in a module description here | |
#| default_exp core | |
#| hide | |
from nbdev.showdoc import * | |
import diskcache as dc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
nixConfig.bash-prompt = ''\033[1;32m\[[nix-develop:\[\033[36m\]\w\[\033[32m\]]$\033[0m ''; | |
inputs = { | |
# doesn't provide cuda_12_2 | |
# leaving this blank most likely loads whatever is on the system | |
# nixpkgs.url = "github:nixos/nixpkgs/23.11-pre"; | |
whacked-setup = { | |
url = "github:whacked/setup/6b73eed531bdf4fde58a8214a94d11c4e024082e"; | |
flake = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import random | |
import math | |
if len(sys.argv) >= 3: | |
num_rows = int(sys.argv[1]) | |
num_columns = int(sys.argv[2]) | |
else: | |
num_rows = 20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
libfec = pkgs.stdenv.mkDerivation rec { | |
pname = "libfec"; | |
version = "0.0.1"; | |
src = pkgs.fetchFromGitHub { | |
owner = "quiet"; | |
repo = "libfec"; | |
rev = "master"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
(def input-file | |
(or (first *command-line-args*) | |
"defaults.css")) | |
(defn parse-css [text] | |
(let [render-buffer (fn [buf] | |
(apply str buf))] | |
(loop [ch-remain text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import atexit | |
import datetime | |
import time | |
import co2meter | |
import json | |
import subprocess as subp | |
import logging | |
logger = logging.getLogger() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref https://www.reddit.com/r/NixOS/comments/6dvm04/how_to_install_emacs_pdftools_with_epdfinfo/di5yii9/ | |
# git clone https://github.com/politza/pdf-tools | |
# run this from within | |
# then M-x package-install-file | |
# select the .tar from the `make` output; the epdfinfo is broken. | |
# then cp the patchelf-ed version into emacs | |
with (import <nixpkgs> {}); | |
stdenv.mkDerivation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; tl;dr: separate atoms is the fastest (1.0x), followed by single atom (1.21x), then separate r/cursors (2.20x) | |
;; `atom` and `r/atom` have basically equivalent performance when used as-is. | |
;; the deeper the cursor, the slower the swap. | |
(let [make-atom r/atom ;; or atom | |
N 1000000 | |
my-atom1 (make-atom 0) | |
my-atom2 (make-atom {:nodes [{:id 1} {:id 2}]}) | |
my-atom3 (make-atom {:app-state {:display {:level5 "oliver"}}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if false; then | |
sudo apt-get update | |
sudo apt-get install -y vim git tmux terminator | |
# rkt | |
gpg --keyserver pgp.mit.edu --recv-key 18AD5014C99EF7E3BA5F6CE950BDD3E0FC8A365E | |
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb | |
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb.asc | |
gpg --verify rkt_1.26.0-1_amd64.deb.asc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if false; then | |
sudo apt-get update | |
sudo apt-get install -y vim git tmux terminator | |
# rkt | |
gpg --keyserver pgp.mit.edu --recv-key 18AD5014C99EF7E3BA5F6CE950BDD3E0FC8A365E | |
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb | |
wget https://github.com/rkt/rkt/releases/download/v1.26.0/rkt_1.26.0-1_amd64.deb.asc | |
gpg --verify rkt_1.26.0-1_amd64.deb.asc |
NewerOlder