This file contains 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
#!/bin/bash | |
current_scheme=$(LANG=C.UTF-8 plasma-apply-colorscheme --list-schemes | awk -F' \\(|\\)' '/current color scheme/ {gsub(/^[ \*]+/, "", $1); print $1}') | |
# if no awk, use grep | |
# current_scheme=$(LANG=C.UTF-8 plasma-apply-colorscheme --list-schemes | grep "current color scheme" | sed 's/^[ \*]*\([^ ]*\) .*/\1/') | |
if [ "$current_scheme" == "BreezeDark" ]; then | |
target_scheme="BreezeLight" | |
elif [ "$current_scheme" == "BreezeLight" ]; then | |
target_scheme="BreezeDark" |
This file contains 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 pulp | |
import re | |
input_string = """ | |
+-------+-------+-------+ | |
| x x x | 6 5 x | x x x | | |
| x x 8 | 4 x x | 9 1 x | | |
| x x x | x x x | x 8 3 | | |
+-------+-------+-------+ | |
| x 6 x | x x x | x x x | |
This file contains 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
services: | |
gitlab: | |
container_name: gitlab | |
image: gitlab/gitlab-ce:16.8.1-ce.0 | |
ports: | |
- "80:80" | |
- "22:22" | |
volumes: | |
- "./config:/etc/gitlab" | |
- "./logs:/var/log/gitlab" |
This file contains 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.8" | |
# 基于 Arch Linux x86_64 的测试环境 | |
# 单用户, 内存占用 2.5G 左右, CPU 需要 2 核, 日常占用 1%. | |
# 树莓派 4B 基于 ARM Cortex-A72, 理论上可以运行 | |
services: | |
gitlab: | |
container_name: gitlab | |
image: gitlab/gitlab-ce:16.8.1-ce.0 # for arm64v8: yrzr/gitlab-ce-arm64v8:16.5.8-ce.0 |
This file contains 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
################################################ | |
# Variable header # | |
################################################ | |
define OWNAS = <OWNAS>; | |
define OWNIP = <OWNIP>; | |
define OWNIPv6 = <OWNIPv6>; | |
define OWNNET = <OWNNET>; | |
define OWNNETv6 = <OWNNETv6>; | |
define OWNNETSET = [<OWNNET>+]; |
This file contains 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 {PrismaClient} from "@prisma/client" | |
const globalForPrisma = globalThis as unknown as {prisma: PrismaClient} | |
export const prisma = | |
globalForPrisma.prisma || new PrismaClient() | |
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma |
This file contains 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 host.skyone.native | |
import kotlinx.cinterop.* | |
import platform.posix.* | |
fun main() { | |
val file = "test.txt" | |
val contentSize = nativeHeap.alloc<stat>().apply { stat(file, this.ptr) }.st_size | |
val buffer = ByteArray(contentSize) | |
val fp = open(file, O_RDONLY) |
This file contains 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 kotlinx.coroutines.runBlocking | |
import kotlinx.serialization.SerialName | |
import kotlinx.serialization.Serializable | |
import kotlinx.serialization.decodeFromString | |
import kotlinx.serialization.json.Json | |
private val json = Json { | |
classDiscriminator = "myType" | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#define offset_of(type, member) ((size_t) &((type *)0)->member) | |
#define container_of(ptr, type, member) ({ \ | |
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |
(type *)( (char *)__mptr - offset_of(type, member) );}) |
NewerOlder