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
| #!/usr/bin/env bash | |
| { # this ensures the entire script is downloaded # | |
| nvm_has() { | |
| type "$1" > /dev/null 2>&1 | |
| } | |
| nvm_echo() { | |
| command printf %s\\n "$*" 2>/dev/null |
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
| #!/bin/sh | |
| # This script downloads the 'ghcup' binary into '~/.ghcup/bin/' and then runs an interactive | |
| # installation that lets you choose various options. Below is a list of environment variables | |
| # that affect the installation procedure. | |
| # Main settings: | |
| # * BOOTSTRAP_HASKELL_NONINTERACTIVE - any nonzero value for noninteractive installation | |
| # * BOOTSTRAP_HASKELL_NO_UPGRADE - any nonzero value to not trigger the upgrade | |
| # * BOOTSTRAP_HASKELL_MINIMAL - any nonzero value to only install ghcup |
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
| #!/bin/sh | |
| set -ue | |
| # (c) Copyright Fabrice Le Fessant INRIA/OCamlPro 2013 | |
| # (c) Copyright Louis Gesbert OCamlPro 2014-2017 | |
| VERSION='2.1.4' | |
| DEV_VERSION='2.1.4' | |
| DEFAULT_BINDIR=/usr/local/bin |
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
| #!/bin/sh | |
| # shellcheck shell=dash | |
| # This is just a little script that can be downloaded from the internet to | |
| # install rustup. It just does platform detection, downloads the installer | |
| # and runs it. | |
| # It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local` | |
| # extension. Note: Most shells limit `local` to 1 var per line, contra bash. |
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
| #!/bin/bash | |
| # Discussion, issues and change requests at: | |
| # https://github.com/nodesource/distributions | |
| # | |
| # Script to install the NodeSource Node.js 18.x repo onto a | |
| # Debian or Ubuntu system. | |
| # | |
| # Run as root or insert `sudo -E` before `bash`: | |
| # |
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
| require 'diff_matcher' | |
| RSpec::Matchers.define :be_hash_matching do |expected| | |
| match do |actual| | |
| opts = {:color_enabled=>RSpec::configuration.color_enabled?} | |
| @difference = DiffMatcher::Difference.new(expected, actual, opts) | |
| @difference.matching? | |
| end | |
| failure_message_for_should do |actual| |
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
| # Simple script to replace first line of Gemfile with taobao's rubygem mirror url | |
| # save as ~/bin/bundle_install_taobao.sh | |
| # create alias in ~/.zsh_alias: alias bi='bash ~/bin/bundle_install_taobao.sh' | |
| # run 'bi' from project folder | |
| echo "Copying Gemfile to Gemfile_taobao using ruby.taobao.org" | |
| echo | |
| taobao="'source http\:\/\/ruby.taobao.org'" | |
| sed "1s/.*/$taobao/" Gemfile > Gemfile_taobao |
NewerOlder