Skip to content

Instantly share code, notes, and snippets.

Avatar

Gong Zhang gongzhang

View GitHub Profile
View toggle_cleanmymac_monitor.sh
#!/bin/sh
set -e
# 查杀/恢复 CleanMyMac 的流氓后台 HealthMonitor
#
# - 执行脚本后,原 HealthMonitor.app 会被备份并被空目录替代,然后杀掉后台进程(你直接杀是杀不净的)。此时 CleanMyMac 主应用也不能运行。
# - 再次执行脚本,则将备份的文件恢复回去,CleanMyMac 则可以正常使用。
#
# NOTE: 如果不是 Setapp 版本,进程名可能不同,需要自行修改下面变量:
View swiftui-inline-modifier.swift
import SwiftUI
import PlaygroundSupport
/// `InlineModifier` helps you apply a view modifier in a inline block.
public struct InlineModifier<R: View>: ViewModifier {
private let block: (Content) -> R
public init(@ViewBuilder _ block: @escaping (Content) -> R) {
View toggle_darkmode.applescript
on run {input, parameters}
(* Your script goes here *)
tell application "System Events"
tell appearance preferences
set dark mode to not dark mode
end tell
end tell
return input
@gongzhang
gongzhang / multi-service-docker-container-script.md
Last active Jul 29, 2018
Multi-Service Container Start-Up Script Template
View multi-service-docker-container-script.md

Multi-Service Container Start-Up Script Template

#!/bin/bash

# Multi-Service Container Start-Up Script Template
#   https://docs.docker.com/config/containers/multi-service_container/

# Start the first process
echo "starting process 1 in screen 'p1'..."
@gongzhang
gongzhang / redmine-docker-compose.md
Last active Jul 29, 2018
Redmine Docker Compose File
View redmine-docker-compose.md

Redmine+MySQL Docker Compose File

File Name: docker-compose.yml

version: '3'

services:
  redmine:
    image: redmine