国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
@PHONY: test | |
test: | |
$(eval TMP := $(shell mktemp -d)) | |
go build -o $(TMP)/toolexec-example.run toolexec-example.go | |
go build -a -toolexec=$(TMP)/toolexec-example.run -o hello main.go | |
./hello && go clean | |
rm -rf $(TMP) |
REVOKE ALL ON DATABASE demo_database FROM demo_user; | |
GRANT CONNECT ON DATABASE demo_database TO demo_user; | |
GRANT USAGE, CREATE ON SCHEMA public TO demo_user; | |
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO demo_user; | |
GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO demo_user; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO demo_user; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE ON SEQUENCES TO demo_user; |
#include <stdio.h> | |
#include <windows.h> | |
#pragma comment(lib, "winmm.lib") | |
void Nothing(WORD wKey) | |
{ | |
} | |
void PrintKey(WORD wKey) |
logger: log.Logger | |
rl_log_buf: []byte | |
rl_log :: proc "c" (logLevel: rl.TraceLogLevel, text: cstring, args: libc.va_list) { | |
context = runtime.default_context() | |
context.logger = logger | |
level: log.Level | |
switch logLevel { | |
case .TRACE, .DEBUG: level = .Debug | |
case .ALL, .NONE, .INFO: level = .Info |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
_
(underscore) to move the cursor at the beginning of line (doesn't switch to insert mode)
0
(zero) moves the cursor to the zeroth position of the line (doesn't switch to insert mode)$
(dollar) to move the cursor at the end of line (doesn't switch to insert mode)d$
will delete from wherever your cursor is till the end of the linef<character>
to move cursor to the first occurrence of <character>
f(
to move cursor to first occurence of (
t<character>
to move cursor to upto but not on the first occurrence of <character>
t(
to move cursor to first occurence of (
from typing import Dict, Union | |
from huggingface_hub import get_safetensors_metadata | |
import argparse | |
import sys | |
# Example: | |
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct | |
# Dictionary mapping dtype strings to their byte sizes | |
bytes_per_dtype: Dict[str, float] = { |
To bypass the Windows 11 Upgrade Assistant and avoid the TPM and CPU requirement checks, you can modify specific registry values to trick the system into thinking your computer meets the necessary requirements. This method addresses common error messages, such as:
The Upgrade Assistant checks the following registry key to determine eligibility:
Let's say you want to use Ruby for the backend of a basic webapp but React on the frontend. Here's how.
(Note: All tested on January 13, 2025 with Ruby 3.3, Sinatra 4.1.1, and React 18.3. Configs may change over time.)
First, create the app folder and set up Sinatra:
mkdir my-sinatra-react-app
+---------------------------------------------------------------+ | |
| * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * | | |
+---------------------------------------------------------------+ | |
\ | |
\ ^ /^ | |
\ / \ // \ | |
\ |\___/| / \// .\ | |
\ /V V \__ / // | \ \ *----* | |
/ / \/_/ // | \ \ \ | | |
@___@` \/_ // | \ \ \/\ \ |