Skip to content

Instantly share code, notes, and snippets.

View duhd1993's full-sized avatar

Haodong DU duhd1993

  • West Lafayette,IN
View GitHub Profile
@ieatfood
ieatfood / Connect Airpods.applescript
Last active November 13, 2024 16:40 — forked from jaredmoody/Connect Airpods.applescript
An Applescript to connect bluetooth devices, such as Airpods. Nice when paired with an alfred trigger.
# Taken from https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/
# by https://github.com/smithumble
use framework "IOBluetooth"
use scripting additions
set AirPodsName to "AirPods"
on getFirstMatchingDevice(deviceName)
repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)
@lancethomps
lancethomps / close_notifications_applescript.js
Last active October 31, 2024 15:09
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
#!/usr/bin/env pwsh
# https://stackoverflow.com/questions/8761888/capturing-standard-out-and-error-with-start-process
function Start-Command ([String]$Path, [String]$Arguments) {
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $Path
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $Arguments
@imba-tjd
imba-tjd / .Cloud.md
Last active November 15, 2024 11:14
☁️ 一些免费的云资源

  • IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装。PaaS提供语言环境和框架(可以自己选)。SaaS只能使用开发好的软件(卖软件本身,如税务会计、表格文字)。BaaS一般类似于非关系数据库,但各家不通用
  • 云服务的特点:零前期成本&按需付费&弹性(类似于租,可随时多加、退掉;但没有残值)、高可用(放在机房中,不同AZ间水电隔离)

其他人的集合

@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active October 27, 2024 08:23
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@fnky
fnky / ANSI.md
Last active November 17, 2024 00:59
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@atyachin
atyachin / Android-Emulator-on-AWS-EC2.txt
Last active August 22, 2024 09:26
Installing and running Android Emulator on Amazon AWS EC2 (Ubuntu 16.04 / m5.xlarge)
Update (2022): https://gist.github.com/atyachin/2f7c6054c4cd6945397165a23623987d
Steps for installing the Android Emulator from EC2 console:
-----------------------------------------------------------
sudo apt install default-jdk
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d android-sdk
sudo mv android-sdk /opt/
export ANDROID_SDK_ROOT=/opt/android-sdk
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active October 30, 2024 08:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话: