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 chaosTestStrings = (): void => { | |
| const textNodes = getAllTextNodes(document.body); | |
| for (const node of textNodes) { | |
| const textNodeLength = node.textContent ? node.textContent.length : 0; | |
| if (node.textContent === null) { | |
| return; | |
| } | |
| if (node.parentElement instanceof Element) { | |
| if (node.parentElement.dataset.originalText === undefined) { |
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
| [ | |
| { | |
| "gameTime": "2022-11-20T16:00:00Z", | |
| "homeTeam": "cat", | |
| "awayTeam": "equ" | |
| }, | |
| { | |
| "gameTime": "2022-11-21T13:00:00Z", | |
| "homeTeam": "ing", | |
| "awayTeam": "ira" |
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
| // ==UserScript== | |
| // @name 字体渲染(自用脚本) | |
| // @name:zh-CN 字体渲染(自用脚本) | |
| // @name:zh-TW 字型渲染(自用程式碼) | |
| // @name:en Font Rendering (Customized) | |
| // @name:ja フォントレンダリング (カスタム) | |
| // @name:ko 폰트 렌더링 (개인용 스크립트) | |
| // @version 2026.07.11.2 | |
| // @author F9y4ng | |
| // @description 无需 MacType,享受细腻高质感的网页阅读体验。脚本默认采用“微软雅黑”,支持自定义替换。面向进阶排版需求,集成字体重写、抗锯齿平滑、动态缩放、描边阴影、特殊样式过滤(白名单)及自定义等宽字体等高级功能。完美支持“全局渲染”与“站点个性化”双模式,点击图标或快捷键即可唤出配置面板。全面兼容主流浏览器、脚本管理器及常用扩展。 |
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
| # ------------------------------------------------------------------ | |
| # EDIT: I eventually found a faster way to run SD on macOS, via MPSGraph (~0.8s / step on M1 Pro): | |
| # https://github.com/madebyollin/maple-diffusion | |
| # The original CoreML-related code & discussion is preserved below :) | |
| # ------------------------------------------------------------------ | |
| # you too can run stable diffusion on the apple silicon GPU (no ANE sadly) | |
| # | |
| # quick test portraits (each took 50 steps x 2s / step ~= 100s on my M1 Pro): | |
| # * https://i.imgur.com/5ywISvm.png |
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
| // Find the latest version of this script here: | |
| // https://gist.github.com/rsms/a8ad736ba3d448100577de2b88e826de | |
| // | |
| const EM = 2048 | |
| interface FontInfo { | |
| familyName :string | |
| styleName :string | |
| unitsPerEm :int | |
| ascender :int |
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
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: deep-blue; icon-glyph: subway; | |
| let GtfsRealtimeBindings = importModule("gtfs-realtime.js") // add this file to Scriptable from https://github.com/MobilityData/gtfs-realtime-bindings/blob/master/nodejs/gtfs-realtime.js | |
| // also add https://github.com/protobufjs/protobuf.js/blob/master/dist/protobuf.min.js to Scriptable | |
| const API_KEY = "paste_your_api_key_here" // get a free MTA API key at https://api.mta.info/#/landing | |
| const ROOT = "entity" | |
| const ALERT = "alert" |
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
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: blue; icon-glyph: bicycle; | |
| /*** WIDGET SETUP *** | |
| * Edit the Scriptable widget, select this CitiBike script, and fill the Parameter field with your station's id | |
| * | |
| * HOW TO FIND A STATION'S ID | |
| * Search for a CitiBike station by street name at https://gbfs.citibikenyc.com/gbfs/en/station_information.json | |
| * Find the station_id field associated with the name |
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
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: brown; icon-glyph: hand-holding-usd; | |
| // To use this script, you must create a personal access token on GitHub with the `read:org// scope. | |
| // Follow the instructions on the link below to create your personal access token. | |
| // | |
| // https://github.com/settings/tokens | |
| // | |
| // Run the script when you ahve created your personal access token. It'll prompt you to enter the token and store it securely in the keychain on the device. |
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
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: blue; icon-glyph: apple-alt; | |
| const TITLE = "" | |
| const DATE = "2021-10-18T17:00:00Z" | |
| const BG_IMG_URL = "https://i.ibb.co/YQ09XTW/background.png" | |
| const TITLE_IMG_URL = "https://i.ibb.co/qYH3Y9w/text.png" | |
| const TITLE_IMG_SIZE = new Size(155, 25) | |
| const LINK = "https://www.youtube.com/watch?v=exM1uajp--A" |
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 transformers import AutoTokenizer, TFAutoModelForSequenceClassification | |
| import tensorflow as tf | |
| model_name = 'bert-base-cased' | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = TFAutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2) | |
| texts = ["I'm a positive example!", "I'm a negative example!"] | |
| labels = [1, 0] |