原文:Python开发者
(点击上方蓝字,快速关注我们)
来源:阿驹的自荐投稿(微信公号:驹说码事)
如有好文章投稿,请点击 → 这里了解详情
前言
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
#!/bin/bash | |
# Remove existing "nameserver" lines from /etc/resolv.conf | |
sed -i '/nameserver/d' /etc/resolv.conf | |
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf | |
# we use full path here to support boot command with root user | |
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null |
import numpy as np | |
from tqdm import trange | |
def get_neighbour_matrix(x, L, R): | |
dx = np.subtract.outer(x[:, 0], x[:, 0]) | |
dy = np.subtract.outer(x[:, 1], x[:, 1]) | |
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2 | |
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2 | |
pair_dist = dx ** 2 + dy ** 2 |
Copyright 2024 Matthew Meyers, Fevol | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US |
#!/usr/bin/env bash | |
# Abort sign off on any error | |
set -e | |
# Start the benchmark timer | |
SECONDS=0 | |
# Repository introspection | |
OWNER=$(gh repo view --json owner --jq .owner.login) |
func observationToRect(box:VNRectangleObservation)->CGRect | |
{ | |
let xCord = box.topLeft.x * imageView.frame.size.width | |
let yCord = (1 - box.topLeft.y) * imageView.frame.size.height | |
let width = (box.topRight.x - box.bottomLeft.x) * imageView.frame.size.width | |
let height = (box.topLeft.y - box.bottomLeft.y) * imageView.frame.size.height | |
return CGRect(x: xCord, y: yCord, width: width, height: height) | |
} |
原文:Python开发者
(点击上方蓝字,快速关注我们)
来源:阿驹的自荐投稿(微信公号:驹说码事)
如有好文章投稿,请点击 → 这里了解详情
前言
module { | |
"name": "schema", | |
"description": "JSON Schema Inference", | |
"version": "0.0.3.1", | |
"homepage": "https://gist.github.com/pkoppstein/a5abb4ebef3b0f72a6ed", | |
"license": "MIT", | |
"author": "pkoppstein at gmail dot com" | |
}; | |
# NEWS: |
This Google Sheets script fetches data from a Supabase database and writes the selected headers and data to the active sheet. The script first clears the sheet, writes the headers, then fetches the data from the Supabase API, and finally writes the data to the sheet. It is optimized and has anonymized variables for public use.
Code.gs
content with the content of supabase_to_google_sheets.gs
.SUPABASE_URL
and SUPABASE_ANON_KEY
variables with your actual Supabase URL and anon key.This plugin adds completion for the Kubernetes cluster manager, as well as some aliases for common kubectl commands.
To use it, add kubectl
to the plugins array in your zshrc file:
plugins=(... kubectl)