Skip to content

Instantly share code, notes, and snippets.

View xiaolai's full-sized avatar
🎯
Focusing

xiaolai xiaolai

🎯
Focusing
View GitHub Profile
@xiaolai
xiaolai / dart_and_flutter.md
Last active October 8, 2021 08:55
Dart & Flutter
# xcode needed
brew install flutter cocoapods android-studio chrome visual-studio-code
flutter doctor --android-licenses
flutter doctor
@xiaolai
xiaolai / ubuntu_at_redmibook.md
Last active September 25, 2021 07:32
UBUNTU@RedmiBook

禁用睡眠

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

启用睡眠

systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target

盖板动作

@xiaolai
xiaolai / Readling-Aloud-MS-EDGE.md
Last active February 23, 2023 08:23
使用微软 Edge 浏览器的朗读功能

微软的浏览器,Edge,是基于 Google 的 Chrome 制作的。最近的新版本中,Edge 推出了基于 AI 的「自动朗读文本」…… 这其实并不是一个新鲜功能 —— IBM Voice 推出(1997)到现在都已经 24 年了…… 当时在 Windows 95 上试用这个功能的时候,纯粹是「鸡肋」的感觉。

1

然而,这一次的确不一样,从用户的角度,它不仅实用,而且真的很好 —— 起码,朗读已经基本上听不出「机器口音」了。

试用了一下之后,马上因为这个功能从各种浏览器中直接迁徙到了 Edge 上。想想微软也是很奇葩,弃用 Windows 的我在十年之后,发现手中用的东西,微软的还挺多,比如,github,vscode, 还有现在的这个 edge…

这个文本朗读功能(Read Aloud)在几天之内就彻底改变了我的新闻阅读习惯 —— 从过去「主要看新闻」直接变成了「只听新闻」…… 尤其是我现在整天站在工作台前的走步机上,更使得我喜欢这个文本朗读功能。

@xiaolai
xiaolai / open-terminal-here.applescript
Created September 5, 2021 05:10
Open Terminal Here
tell application "Finder"
if (count of windows) > 0 then
set thePath to target of front window
else
display dialog "There are no open Finder windows." with icon caution buttons {"OK"} with title "Open Terminal Here..."
return
end if
end tell
if not (exists thePath) then
@xiaolai
xiaolai / Install-Softwares-on-a-New-MacOS.md
Last active August 3, 2023 15:05
Install Softwares on a New MacOS (with M1 chip)

打开一个新的 Mac(iMac、Macbook 等等),即便你是新手,要第一个使用的,就是 Terminal 程序。

在新的 Mac 上打开 Terminal 程序的方法有以下几个:

  • 先点击 Dock 上的 Launchpad 图标 ,而后在搜索框里输入 Terminal,随后通过点击打开。
  • 在 Finder 程序里 ,打开 /Applications/Utilities 文件夹,双击里面的 Terminal 程序图标。
  • 使用快捷键 ⌘ + Space 呼出 Spotlight,输入 Terminal 而后按 键,即,Return 键。

我的 Terminal 刚打开的时候是这样的:

@xiaolai
xiaolai / qt_9_windows.applescript
Last active August 27, 2021 04:01
Align 9 Quicktime Windows to 3x3 grid
on getDesktopSize()
tell application "Finder"
set screen_resolution to bounds of window of desktop
end tell
return {item -2 of screen_resolution, item -1 of screen_resolution}
end getDesktopSize
on putToPosition(n)
set window_width to round ((item 1 of getDesktopSize()) / 3) - 1
set window_height to round ((item 2 of getDesktopSize()) / 3) - 1
@xiaolai
xiaolai / running-kindle-apk-on-Mac-with-M1-Chip.md
Last active July 24, 2022 13:02
在 M1 芯片苹果电脑上运行 Kindle 安卓版

这些年我在 Amazon 上买了几近千本的电子书(其中相当一部分配有有声版的 Audiobook)。在 iOS(iPad/iPhone)上体验还算可以,有 Kindle App,也有 Audible App —— 唯一的缺陷是,每次换设备的时候,都得重新下载一遍,并且,Amazon 的开发人员执拗地在这么多年过后也不给加一个「全部下载」的方式…… 我甚至开始不讲道理地怀疑这帮鸟人自己的 Kindle 里都不超过十本书,所以才不把「下载全部」当回事儿。

MacOS 上一直就没有 Audible,得通过 iTunes 转手一遍,非常讨厌;而 Kindle App 就更讨厌了,一直保持着远古时代的 UI 不说,这都好多年了,坚决不给加上「如果有配套有声书的话就可以边朗读边划线阅读」的功能 —— 而这功能恰恰是 iOS 上的 Kindle App 最令人喜欢的,乃至于其它功能差一点都能因此忍受的……

MacOS Big Sur 刚推出的时候,增加了个功能,就是 iOS 的 App 可以直接安装到 MacOS 上 —— 真是太棒了!可惜,没高兴几天,苹果给了开发者一个选择,Amazon 的开发者选择的结果是,在 MacOS 上不能安装 Kindle for iOS,在 MacOS 只能接着用他们那个愚蠢到死的桌面版本 —— Kindle for Desktop 的团队就应该直接解散掉啊!一个常年只能打两颗星的产品,不应该着急一点吗?

现在在 MacOS App Store 里搜索 Kindle(iPhone & iPad Apps)不再显示 Kindle 了,搜出来的都是不相干的玩意……

于是,想到了个办法:

@xiaolai
xiaolai / appify
Created August 6, 2021 09:06 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@xiaolai
xiaolai / gist:2a512c01213de38405b683a85f6fb759
Last active December 29, 2020 11:30
Terminal Settings

Screen-Shot-2020-12-29-at-7-19-24-PM

ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_PROMPT_ON_NEWLINE="true"
@xiaolai
xiaolai / coursera-dl.md
Created March 29, 2020 04:16
Download Coursera Material