- Don't WTF quite so much when looking at C++ PRs
- Know what you don't know (so you know what to look up to learn more)
Discover gists
function! ClipboardCopy(lines, regtype) | |
let sum = TryClipboardCmd('md5sum', a:lines) | |
call writefile(sum, s:regtype_sum, 'S') | |
call writefile([a:regtype], s:regtype_txt, 'S') | |
return TryClipboardCmd('clipboard-provider copy', a:lines) | |
endfunction | |
function! ClipboardPaste() | |
let lines = TryClipboardCmd('clipboard-provider paste') | |
let regtype = 'V' |
[Tuya][]'s IR blasters, like the [ZS08][], have the ability to both learn and blast generic IR codes. These IR codes are given to the user as an opaque string, like this:
A/IEiwFAAwbJAfIE8gSLIAUBiwFAC+ADAwuLAfIE8gSLAckBRx9AB0ADBskB8gTyBIsgBQGLAUALA4sB8gRAB8ADBfIEiwHJAeARLwHJAeAFAwHyBOC5LwGLAeA97wOLAfIE4RcfBYsB8gTyBEAFAYsB4AcrCYsB8gTyBIsByQHgPY8DyQHyBOAHAwHyBEAX4BVfBIsB8gTJoAMF8gSLAckB4BUvAckB4AEDBfIEiwHJAQ==
Not much is known about the format of these IR code strings, which makes it difficult to use codes obtained through other means (such as a
import FormData from 'form-data'; | |
import axios from 'axios'; | |
import fs from 'fs'; | |
interface ICloneVoiceParams { | |
description:string; | |
name:string; | |
fileUrls: string[]; | |
labels: Record<string,string>; |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; | |
use bevy::prelude::*; | |
use bevy::window::close_on_esc; | |
const WW: f32 = 1200.0; | |
const WH: f32 = 900.0; | |
const BG_COLOR: (u8, u8, u8) = (25, 20, 43); | |
fn main() { | |
App::new() |
https://swift.org/documentation/api-design-guidelines/
-
사용할 때 기준으로 명확하게 작성하는 게 가장 중요한 지향점이다. 메소드나 프로퍼티 같은 개발 요소는 한 번만 선언하고 반복적으로 사용한다. API를 만들 때는 사용하기 명확하고 편하게 만들어야 한다. 설계를 검증할 때 선언 부분을 읽는 것만으로는 부족하다. 그 대신 사용하는 상황에서 맥락에 맞고 명확한 지 늘 고려해야 한다.
-
명확한 표현이 압축한 간결성보다 더 중요하다. 스위프트 코드는 압축해서 간결하게 작성할 수 있지만, 단지 글자수를 줄여서 가장 짧은 코드를 만드는 게 목표는 아니다. 스위프트 코드의 간결성은 자연스럽게 반복적으로 재사용하는 코드(boilerplate)를 줄이는 기능과 강한 타입 시스템의 부수효과로 드러날 뿐이다.
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.
The script will create backups using tar
with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.
To create backup script that will be executed every day we can create backup script in /etc/cron.daily/
folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:
touch /etc/cron.daily/pvehost-backup