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
| # ----------------------------------------------------------------------------- | |
| # AI-powered Git Commit Function | |
| # Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
| # 1) gets the current staged changed diff | |
| # 2) sends them to an LLM to write the git commit message | |
| # 3) allows you to easily accept, edit, regenerate, cancel | |
| # But - just read and edit the code however you like | |
| # the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
| gcm() { |
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
| How-To: create bootable USB-stick from ISO image: | |
| ================================================= | |
| 1. Download ISO image file: | |
| wget -o ~/Desktop/mini.iso http://ftp.nl.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/mini.iso | |
| 2. Convert ISO file to DMG format using hdiutil: | |
| hdiutil convert -format UDRW -o Desktop/mini.img Desktop/mini.iso |
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
| # Set prefix command to Ctrl-i; one of the easiest keys to reach | |
| set -g prefix C-b | |
| unbind C-a | |
| # Reduce tmux delay for more responsiveness | |
| set -sg escape-time 1 | |
| # Window and pane index count starts in 1 rather tan 0 | |
| set -g base-index 1 | |
| setw -g pane-base-index 1 |
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
| def within_list(css_class) | |
| css_selector = css_class.gsub(/ /, '.') #stack the css classes for selection | |
| list = current_dom.at("ol.#{css_selector}") || current_dom.at("ul.#{css_selector}") # Could add an opt param to the method to make this explicit - for now we don't care | |
| assert_not_nil(list, "Expected to find a ul or li tag matching the css class '#{css_class}'") | |
| yield list | |
| end | |
| Then /^I should see the text "(.*)" in the "(.*)" list$/ do |text, css_class| #" | |
| within_list(css_class) do |list| | |
| matching_list_items = list.search("li").select{ |li| strip_html_tags_from(li.inner_html) =~ escape_text_for_regexp(text) } |