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 React from 'react'; | |
| import faTrashAlt from '@fortawesome/fontawesome-free-solid/faTrashAlt'; | |
| import faUser from '@fortawesome/fontawesome-free-solid/faUser'; | |
| import { classes, extension } from 'common/util'; | |
| import { actions } from 'reducers'; | |
| import { connect } from 'react-redux'; | |
| import { languages } from 'common/config'; | |
| import { Button, Ellipsis, FoldableAceEditor } from 'components'; | |
| import styles from './CodeEditor.module.scss'; |
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
| let f = length => Array.from({length}).map((v,k) => k); |
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
| -- 操作的Redis Key | |
| local rate_limit_key = KEYS[1] | |
| -- 每秒最大的QPS许可数 | |
| local max_permits = ARGV[1] | |
| -- 此次申请的许可数 | |
| local incr_by_count_str = ARGV[2] | |
| -- 当前已用的许可数 | |
| local currentStr = redis.call('get', rate_limit_key) | |
| local current = 0 | |
| if currentStr then |
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
| <html> | |
| <body> | |
| <script> | |
| /** | |
| * This array diff algorithm is useful when one wants to detect small changes | |
| * (like consecutive insertions or consecutive deletions) several times | |
| * in short time intervals. Alternative algorithms like LCS woud be too expensive | |
| * when running it too many times. | |
| */ |
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
| package main | |
| import ( | |
| "io" | |
| "net/http" | |
| "os/exec" | |
| ) | |
| var ( | |
| BUF_LEN = 1024 |
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
| version: "3" | |
| services: | |
| kafka: | |
| image: wurstmeister/kafka:2.11-0.11.0.3 | |
| restart: on-failure:3 | |
| links: | |
| - zookeeper | |
| ports: | |
| - "9092:9092" | |
| - "9093:9093" |
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
| // Open the cgroup hierarchy of the current container | |
| f, err := os.Open("/sys/fs/cgroup/memory/memory.limit_in_bytes") | |
| if err != nil { | |
| // Handle error | |
| } | |
| defer f.Close() | |
| // Read the maximum memory limit from the file | |
| var maxMemLimit int64 | |
| _, err = fmt.Fscanf(f, "%d", &maxMemLimit) |
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 { | |
| createParser, | |
| ParsedEvent, | |
| ReconnectInterval, | |
| } from "eventsource-parser"; | |
| export interface OpenAIStreamPayload { | |
| model: string; | |
| prompt: string; | |
| temperature: number; |
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 SwiftUI | |
| struct AppleIntelligenceScreenColorGlowView: View { | |
| var body: some View { | |
| let text = Text("Hello, World!") | |
| .bold() | |
| .font(.title) | |
| .frame(maxWidth: .infinity, maxHeight: .infinity) | |
| .ignoresSafeArea() | |
OlderNewer