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 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
| #!/bin/bash | |
| # Configuration variables - modify these | |
| VPN_CONFIG="config.ovpn" # Set the path of the .ovpn file | |
| SSH_HOST="0.0.0.0" | |
| SSH_PORT="22" | |
| SSH_USER="ubuntu" | |
| LOCAL_PORT="2222" # Local port to forward SSH through | |
| # Function to check if required commands exist |
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
| # Git | |
| alias g=git | |
| alias ga='git add' | |
| alias gaa='git add --all' | |
| alias gb='git branch' | |
| alias gc='git commit -m' | |
| alias gcam='git commit -a -m' | |
| alias gca='git commit --amend' | |
| alias gca!='git commit --amend --no-verify' |
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
| /** | |
| * @link https://twitter.com/coproduto/status/1783128938149023804 | |
| * @param {Number} value The value to be converted into coins | |
| * @param {Array<number>} coins The available coins | |
| * @returns {Array<number>} The coins that make up the value | |
| */ | |
| export function getChangeOptions(value, coins) { | |
| const sortedCoins = coins.slice().sort((a, b) => b - a) | |
| const changeOptions = [] |
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
| /** | |
| * Check if given string is balanced, i.e., if it has the same number of open and close delimiters. | |
| * The following delimiters are considered: '(', ')', '[', ']', '{', '}'. | |
| * A string with no delimiters is considered balanced. | |
| * | |
| * @link https://twitter.com/coproduto/status/1782352142050775113 | |
| * @param str {String} to check if it is balanced | |
| * @returns {Boolean} | |
| */ | |
| export function isBalanced(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
| type Moves = "rock" | "paper" | "scissors"; | |
| type RockPaperScissors<_Move extends Moves> = _Move extends "rock" | |
| ? "paper" | |
| : _Move extends "paper" | |
| ? "scissors" | |
| : "rock"; | |
| type Result = RockPaperScissors<"rock">; // expected to be 'paper' |
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
| // Extends the return of the HTTPError class | |
| class HTTPError extends Error { | |
| readonly response: any; | |
| readonly status: number; | |
| readonly statusText: string; | |
| constructor(status: number, statusText: string, response: any) { | |
| super(statusText); | |
| this.status = status; | |
| this.statusText = statusText; |
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
| captainVersion: 4 | |
| services: | |
| '$$cap_appname': | |
| caproverExtra: | |
| dockerfileLines: | |
| - FROM alpine:3.16.2 | |
| - RUN apk add --no-cache unzip openssh | |
| - ADD https://github.com/pocketbase/pocketbase/releases/download/v$$cap_version/pocketbase_$$cap_version_linux_amd64.zip /tmp/pb.zip | |
| - RUN unzip /tmp/pb.zip -d /pb/ |
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
| captainVersion: 4 | |
| version: '3.3' | |
| services: | |
| $$cap_appname: | |
| container_name: $$cap_appname | |
| environment: | |
| BASEROW_PUBLIC_URL: http://$$cap_appname.$$cap_root_domain | |
| volumes: | |
| - $$cap_appname-data:/baserow/data | |
| restart: unless-stopped |
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
| /* Tornando todas as imagens do site responsivas */ | |
| img { | |
| width: 100%; | |
| height: auto; | |
| } |
NewerOlder