Skip to content

Instantly share code, notes, and snippets.

View yi-ge's full-sized avatar
🎯
Focusing

Yige yi-ge

🎯
Focusing
View GitHub Profile
@yi-ge
yi-ge / 1Password去重脚本.py
Last active July 7, 2023 06:51
该脚本首先获取所有重复的title,然后提取相关的ID。接着,脚本通过比较Fields和URLs部分,找到重复的项目并将多余的项目ID添加到一个列表中。最后,根据需要,您可以选择删除多余的项目。 相关博文:《1Password去重脚本》 https://www.wyr.me/post/741
import os
import re
import time
import pickle
import subprocess
from collections import defaultdict
def run_command(command, error_msg=None, show_output=True):
try:
@yi-ge
yi-ge / badge.svg
Last active January 30, 2024 02:11
C++
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}
{{ define "upstream" }}
{{ if .Address }}
{{/* If we got the containers from swarm and this container's port is published to host, use host IP:PORT */}}
{{ if and .Container.Node.ID .Address.HostPort }}
# {{ .Container.Node.Name }}/{{ .Container.Name }}
server {{ .Container.Node.Address.IP }}:{{ .Address.HostPort }};
{{/* If there is no swarm node or the port is not published on host, use container's IP:PORT */}}
{{ else if .Network }}
[alias]
  commit-including-submodule = "!f() { \
  if [ -u $1 ]; then \
    git submodule foreach \"git add --all && git commit -m 'update - `date '+%Y-%m-%d %T'`' || :\"; \
    git add --all && git commit -m \"update - `date '+%Y-%m-%d %T'`\"; \
    echo \"success\"; \
  else \
    git submodule foreach 'git add --all && git commit -m \"$1\" || :'; \
    git add --all && git commit -m $1; \
    echo \"success\"; \