name: tufte-viz description: | Ideate and critique data visualizations using Edward Tufte's principles from "The Visual Display of Quantitative Information." Use this skill when: (1) Designing new data visualizations or charts (2) Critiquing or improving existing visualizations (3) Reviewing dashboards or reports for graphical integrity (4) Deciding between visualization approaches (5) Reducing chartjunk or improving data-ink ratio (6) Planning small multiples or high-density displays
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
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
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
| ;;; hole-mode.el --- fill holes with GPT-4 -*- lexical-binding: t -*- | |
| ;; Author: Mikael Brockman <[email protected]> | |
| ;; Version: 1.0 | |
| ;;; Commentary: | |
| ;; This package provides a minor mode for filling holes in code with AI. | |
| ;; | |
| ;; It is designed to work with the `llm' command-line tool, which is a |
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
| # Detect the correct TERM value for new sessions. | |
| # if-shell uses /bin/sh, so bashisms like [[ do not work. | |
| if "[ $(tput colors) = 16777216 ]" { | |
| set -g default-terminal "tmux-direct" | |
| } { | |
| if "[ $(tput colors) = 256 ]" { | |
| set -g default-terminal "tmux-256color" | |
| } { | |
| set -g default-terminal "tmux" | |
| } |
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 bash | |
| function p() { | |
| jq -n \ | |
| --arg content "$*" \ | |
| '{ | |
| "model": "pplx-7b-online", | |
| "messages": [ | |
| { | |
| "role": "system", | |
| "content": "Be precise and concise." |
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 -S rust-script -t nightly | |
| #![feature(unix_sigpipe)] | |
| use std::cmp::max; | |
| const BASIC_COLORS: &[&str] = &[ | |
| "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", | |
| ]; | |
| fn title(t: &str) { |
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
| Two pointers: one input, opposite ends | |
| ```python3 | |
| def fn(arr): | |
| left = ans = 0 | |
| right = len(arr) - 1 | |
| while left < right: | |
| # do some logic here with left and right | |
| if CONDITION: |
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
| (unless (display-graphic-p) | |
| (add-hook 'after-make-frame-functions | |
| '(lambda | |
| ;; Take advantage of iterm2's CSI u support (https://gitlab.com/gnachman/iterm2/-/issues/8382). | |
| (xterm--init-modify-other-keys) | |
| ;; Courtesy https://emacs.stackexchange.com/a/13957, modified per | |
| ;; https://gitlab.com/gnachman/iterm2/-/issues/8382#note_365264207 | |
| (defun character-apply-modifiers (c &rest modifiers) | |
| "Apply modifiers to the character C. |
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 cv2 | |
| import time | |
| import math | |
| import numpy as np | |
| import tensorflow as tf | |
| class SsdAnchorsCalculatorOptions: | |
| def __init__(self, input_size_width, input_size_height, min_scale, max_scale | |
| , num_layers, feature_map_width, feature_map_height | |
| , strides, aspect_ratios, anchor_offset_x=0.5, anchor_offset_y=0.5 |
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
| sudo add-apt-repository -y ppa:apt-fast/stable | |
| sudo add-apt-repository -y ppa:graphics-drivers/ppa | |
| sudo apt-get update | |
| sudo apt-get -y install apt-fast | |
| # prompts | |
| sudo apt-fast -y upgrade | |
| sudo apt-fast install -y python3-pip ubuntu-drivers-common libvorbis-dev libflac-dev libsndfile-dev cmake build-essential libgflags-dev libgoogle-glog-dev libgtest-dev google-mock zlib1g-dev libeigen3-dev libboost-all-dev libasound2-dev libogg-dev libtool libfftw3-dev libbz2-dev liblzma-dev libgoogle-glog0v5 gcc-6 gfortran-6 g++-6 doxygen graphviz libsox-fmt-all parallel exuberant-ctags vim-nox python-powerline python3-pip ack lsyncd | |
| sudo apt-fast install -y tigervnc-standalone-server firefox mesa-common-dev |
NewerOlder