Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| # coding=utf-8 | |
| # Copyright 2023 The HuggingFace Inc. team. All rights reserved. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software |
| // Website you intended to retrieve for users. | |
| const upstream = 'api.openai.com' | |
| // Custom pathname for the upstream website. | |
| const upstream_path = '/' | |
| // Website you intended to retrieve for users using mobile devices. | |
| const upstream_mobile = upstream | |
| // Countries and regions where you wish to suspend your service. |
| # spec/system/support/login_helpers.rb | |
| # See this blog post for setup guide: https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing | |
| module LoginHelpers | |
| def login_as(user) | |
| # Craft session cookie to make request authenticated (to pass even routing constraints) | |
| # Compilation of these: | |
| # - https://dev.to/nejremeslnici/migrating-selenium-system-tests-to-cuprite-42ah#faster-signin-in-tests | |
| # - https://turriate.com/articles/2011/feb/how-to-generate-signed-rails-session-cookie | |
| # - https://github.com/rails/rails/blob/43e29f0f5d54294ed61c31ddecdf76c2e1a474f7/actionpack/test/dispatch/cookies_test.rb#L350 |
| # 基础引擎框架配置,patch 会更新 default.yaml 文件 | |
| patch: | |
| schema_list: | |
| - schema: double_pinyin_flypy | |
| - schema: luna_pinyin_simp | |
| switcher/hotkeys: | |
| # 切换选项菜单的快捷键 | |
| - "Alt+Shift+grave" | |
| - "Control+grave" |
| const puppeteer = require('puppeteer') | |
| const fs = require('fs'); | |
| // Hardcoded for 200 shapes | |
| (async () => { | |
| const browser = await puppeteer.launch({ headless: true }) | |
| const page = await browser.newPage() | |
| await page.goto('https://ondras.github.io/primitive.js/', { waitUntil: 'networkidle0' }) | |
| const files = fs.readdirSync('img') // Input Folder | |
| for (let i = 0; i < files.length; i++) { |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| convert -resize '368x268!' -delay 50 *.png animation.gif | |
| gifsicle --colors 256 animation.gif --no-loopcount > animation2.gif | |
| gifsicle -O3 --lossy=80 animation2.gif -o animation3.gif |
| import * as React from 'react' | |
| // routing, etc. | |
| import { Reset } from '~/ui/shared/Reset' | |
| export class App extends React.Component { | |
| public render() { | |
| return ( | |
| <div> | |
| <title>Dashboard</title> |
| const traceProperty = (object, property) => { | |
| let value = object[property]; | |
| Object.defineProperty(object, property, { | |
| get () { | |
| console.trace(`${property} requested`); | |
| return value; | |
| }, | |
| set (newValue) { | |
| console.trace(`setting ${property} to `, newValue); | |
| value = newValue; |