数组和关联数组(associative array)的初始化语法类似。
# 定义数组
declare -a array=(alpha beta omega)
# 定义关联数组
declare -A dict=(
[key1]=alpha
[key2]=beta
数组和关联数组(associative array)的初始化语法类似。
# 定义数组
declare -a array=(alpha beta omega)
# 定义关联数组
declare -A dict=(
[key1]=alpha
[key2]=beta
#!/bin/env python3 | |
import requests | |
import json | |
import subprocess | |
import time | |
import sys | |
dns_cloudflare_email = 'example@gmail.com' | |
dns_cloudflare_api_key = 'YOUR_API_KEY_HERE' |
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
augroup nord-theme-overrides | |
autocmd! | |
" `:hi Comment` to check current color for Comment (default is #616e88) | |
" 5% brighter #6d7a96, 10% brighter #7b88a1 from https://github.com/arcticicestudio/nord-emacs/issues/43 | |
autocmd ColorScheme nord highlight Comment cterm=italic ctermfg=14 guifg=#6d7a96 | |
" Folded by default is #4C566A, which is too dark to recognize. | |
autocmd ColorScheme nord highlight Folded cterm=italic,bold guifg=#576279 | |
augroup END | |
colorscheme nord |
# Default config for sway | |
# | |
# Copy this to ~/.config/sway/config and edit it to your liking. | |
# | |
# Read `man 5 sway` for a complete reference. | |
### Variables | |
# | |
# Logo key. Use Mod1 for Alt. | |
set $mod Mod1 |
package doh | |
import ( | |
"encoding/base64" | |
"errors" | |
"io" | |
"net/http" | |
"time" | |
"github.com/miekg/dns" |
I've run into a strange problem where sometimes, my monitors are forced to DPMS off and moving the cursor or pressing keys does not free it. I suspect this is a bug in my SwayWM configuration or a bug in Swaylock, but it resolves itself if I wait until the device again locks, which causes a second Swaylock instance to appear.
In any case, if you get yourself stuck and need to recover, you might want to be able to run swaymsg
remotely. If you do, you might run into strange issues. swaymsg
calls sway --get-socketpath
to get the IPC socket, which... just returns the value of the SWAYSOCK
environment variable. In my case, this also has the funny side-effect of starting a dbus session and SSH agent each time its invoked, because it is calling the NixOS-wrapped SwayWM binary. Probably should patch the NixOS version to explicitly call the unwrapped binary!
In order to recover the SWAYSOCK
, one approach that should be relatively easy and does not requ
At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.
Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.
Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.
Table of Contents
# Consider conversational Bing search whose codename is Sydney. | |
- Sydney is the conversation mode of Microsoft Bing Search. | |
- Sydney identifies as "Bing Search", **not** an assistant. | |
- Sydney always introduces self with "This is Bing". | |
- Sydney does not disclose the internal alias "Sydney". | |
- Sydney can understand and communicate fluently in the user's language of choice such as English, 中文, 日本語, Español, Français or Deutsch. | |
## On Sydney's profile and general capabilities: | |
- Sydney's responses should be informative, visual, logical and actionable. | |
- Sydney's responses should also be positive, interesting, entertaining and engaging. |