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 inference a GPT LLM in pure, dependency-free Python. | |
| Differences from GPT-2 are minor: rmsnorm instead of layer norm, no biases, square ReLU instead of GeLU nonlinearity. | |
| The contents of this file is everything algorithmically needed to train a GPT. Everything else is just efficiency. | |
| Art project by @karpathy. | |
| """ | |
| import os # for os.path.exists | |
| import math # for math.log, math.exp | |
| import random # for random.seed, random.choices |
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
| # Tries to match everything until the owner field as the workspace name (thanks redgate sql source control) | |
| tf workspaces /owner:domain\username| | |
| Select-Object -Skip 2 | | |
| ForEach-Object { | |
| if ($_ -match "^(.*?)Username") { | |
| $workspace = $Matches[1].Trim() | |
| Write-Host "Will delete workspace: $workspace" | |
| tf workspace /delete "$workspace;domain\username" /noprompt | |
| } |
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
| # Delete all bin and obj folders recursively | |
| function del-obj-bin { | |
| Param ([string]$Path = ".\") | |
| $title = 'Delete all nested obj and bin folders' | |
| $question = 'Are you sure you want to proceed?' | |
| $choices = '&Yes', '&No' | |
| $decision = $Host.UI.PromptForChoice($title, $question, $choices, 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
| import { computed, Comment, Fragment, Text } from 'vue' | |
| /** | |
| * Determines whether a slot is empty for Vue 3: https://github.com/vuejs/vue-next/issues/3056 | |
| * @param {Function} slot - The slot $slot.name | |
| * @returns {Boolean} | |
| */ | |
| // Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77 |
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
| function Invoke-ChatGPT { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory = $true, Position = 0)] | |
| [string]$Prompt, | |
| [Parameter(Mandatory = $false)] | |
| [int]$MaxTokens = 50 | |
| ) |
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 { useSlots } from 'vue'; | |
| export default function useHasSlot() { | |
| const slots = useSlots(); | |
| return function hasSlot(name) { | |
| return slots[name] && !isEmptySlot(slots[name]()); | |
| }; | |
| } | |
| function isEmptySlot(items) { |
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
| pico-8 cartridge // http://www.pico-8.com | |
| version 39 | |
| __lua__ | |
| function _init() | |
| mouse.init() | |
| points = {} | |
| sticks = {} | |
| bounce=0.9 |
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
| --[[ pancelor printh debugging | |
| from https://www.lexaloffle.com/bbs/?tid=42367 | |
| pq() is your swiss army knife | |
| for debugging. use it to check | |
| what your computer is actually | |
| doing! | |
| basic usage: | |
| pq(x,y) - this is similar to | |
| calling printh(x..y) |
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
| --from https://www.lexaloffle.com/bbs/?tid=3549 | |
| mouse = { | |
| init = function() | |
| poke(0x5f2d, 1) | |
| end, | |
| -- return int:x, int:y, onscreen:bool | |
| pos = function() | |
| local x,y = stat(32)-1,stat(33)-1 | |
| return stat(32)-1,stat(33)-1 | |
| end, |
NewerOlder