🧙♂️
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 main(exports) { | |
| var KONAMI_KEYS = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65] | |
| var KONAMI_KEYS_LENGTH = KONAMI_KEYS.length | |
| var callbacks = [] | |
| var index = 0 | |
| document | |
| .documentElement | |
| .addEventListener('keydown', detect, true) |
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
| export const dom = (tag, attributes = {}, ...children) => { | |
| const element = document.createElement(tag) | |
| for (const attribute in attributes) { | |
| if (attributes.hasOwnProperty(attribute)) { | |
| element.setAttribute(attribute, attributes[attribute]) | |
| } | |
| } | |
| const fragment = document.createDocumentFragment() | |
| children.forEach((child) => { | |
| if (typeof child === 'string') { |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
| <title>Demo</title> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css"> | |
| <style>nav { background-color: #26a69a; } main { height: calc(100vh - 64px); overflow-y: auto; } .center-cropped { height: 250px; object-fit: cover; object-position: center; } [data-tag]::before { content: attr(data-tag) }</style> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |
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
| const createLogger = (backgroundColor, color, enabled = true) => ( | |
| message, | |
| ...args | |
| ) => { | |
| if (!enabled) { | |
| return; | |
| } | |
| console.groupCollapsed( | |
| `%c${message}`, | |
| `background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`, |
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
| var getTableSize = function(db, dbName){ | |
| return new Promise((resolve,reject) => { | |
| if (db == null) { | |
| return reject(); | |
| } | |
| var size = 0; | |
| db = event.target.result; | |
| var transaction = db.transaction([dbName]) | |
| .objectStore(dbName) | |
| .openCursor(); |
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
| ## Kodo multi-stage docker image ## | |
| # build project with typescript | |
| FROM node:16.15.1-stretch as ts-compiler | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| COPY tsconfig*.json ./ | |
| RUN npm install | |
| COPY . ./ | |
| RUN npm run build |
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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [ opened, synchronize ] | |
| name: Dependabot Bun Support | |
| permissions: |
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 |
OlderNewer