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
tell application "System Events" | |
tell process "Safari" | |
set frontmost to true | |
-- Reference Safari window | |
set safariWindow to front window | |
delay 0.5 | |
set sidebarVisible to false | |
try |
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 Foundation | |
// MARK: - Main Request Body | |
/// Represents the request body for creating a chat completion. | |
public struct ChatCompletionRequest: Codable { | |
/// A list of messages comprising the conversation so far. | |
public let messages: [Message] | |
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 Async | |
import AVFoundation | |
import MetalKit | |
import Combine | |
class PreviewMetalView: MTKView { | |
enum ContentMode { | |
case resizeAspectFit | |
case resizeAspectFill |
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
// .sourcekit-lsp/config.json | |
{ | |
"swiftPM": { | |
"triple": "arm64-apple-ios", | |
"swiftCompilerFlags": [ | |
"-sdk", | |
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk" | |
], | |
"cCompilerFlags": [ | |
"-isysroot", |
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 ; | |
import java.util.*; | |
import java.util.function.BiFunction; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
import java.util.stream.StreamSupport; |
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
gui: | |
sidePanelWidth: 0.25 | |
git: | |
paging: | |
colorArg: always | |
externalDiffCommand: 'difft --color=always --display="$([ $(tput cols) -lt 180 ] && echo inline || echo side-by-side-show-both)" --context=4' # side-by-side-show-both | |
# externalDiffCommand: tput cols | |
keybinding: | |
universal: |
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
@RequiredArgsConstructor | |
public class Client { | |
public <T> Result<T> execute(Object requset, Class<?>... types) { | |
String content = <json response> | |
return JSONObject.parseObject(content, buildType(ArrayUtil.append(new Class[]{Result.class}, types))); | |
} |
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 *.gateway.fliter; | |
import lombok.RequiredArgsConstructor; | |
import org.springframework.cloud.gateway.filter.GatewayFilterChain; | |
import org.springframework.cloud.gateway.filter.GlobalFilter; | |
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; | |
import org.springframework.core.Ordered; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.codec.HttpMessageReader; | |
import org.springframework.http.codec.ServerCodecConfigurer; |
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
# ring = "0.16.20" | |
use ring::*; | |
use ring::aead::{Aad, AES_128_GCM, BoundKey, Nonce, OpeningKey, SealingKey, UnboundKey}; | |
static ALGORITHM: &aead::Algorithm = &AES_128_GCM; | |
struct OneNonceSequence(Option<aead::Nonce>); | |
impl OneNonceSequence { |
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
fl () { | |
API="" | |
ret_json=$(curl -s -H "Content-Type: application/json" -X POST -d "{\"content\":\"$*\"}" $API) | |
echo $ret_json | sed "s/.*\"message\":\([^,}]*\).*/\1/" | |
} |
NewerOlder