Skip to content

Instantly share code, notes, and snippets.

View maboloshi's full-sized avatar
💭
I may be slow to respond.

沙漠之子 maboloshi

💭
I may be slow to respond.
  • 01:13 (UTC +08:00)
View GitHub Profile
@maboloshi
maboloshi / gist:ab9beafa89be01123bf277130339606f
Last active February 13, 2022 12:39 — forked from parano/gist:1868242
Excel表格密码保护的解除方法 (仅适用于旧版 .xls 文件格式)
表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。
若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。
可能会提示输入密码。这时候我们可以用VBA宏代码破解法来破解表格保护密码:
第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,
打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”
再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:
PasswordBreaker,点击“确定”退出;
第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,
打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:
@maboloshi
maboloshi / get_latest_release_number.sh
Last active February 17, 2019 12:38 — forked from lukechilds/get_latest_release.sh
[Shell - Get latest release number from repository on GitHub ] 从GitHub上的存储库获取最新版本号, 不适用不规范发布 #github #shell
get_latest_release_number() {
curl --silent "https://github.com/$1/releases/latest" | sed 's#.*tag/\(.*\)".*#\1#'
}
# Usage
# $ get_latest_release_number "creationix/nvm"
# v0.34.0
@maboloshi
maboloshi / RSS_add_to_Inoreader.js
Last active May 24, 2021 04:56 — forked from ttttmr/RSS_to_Inoreader.js
[一键订阅Inoreader书签脚本] 可用于在浏览器创建一个"一键订阅至Inoreader"的脚本书签按钮
javascript: (function () {
let rsshub_host = 'https://rsshub.app';
let cnblog = 'https://www.cnblogs.com/';
let csdn = 'https://blog.csdn.net/';
let jianshu_user = '/jianshu/user/';
let zhihu_user = '/zhihu/people/activities/';
let zhihu_collection = '/zhihu/collection/';
let zhihu_zhuanlan = '/zhihu/zhuanlan/';
let bilibili_user = '/bilibili/user/video/';
[Version]
Signature="$Windows NT$"
[DefaultInstall]
AddReg=SublimeText3
[SublimeText3]
hkcr,"*\\shell\\SublimeText3",,,"Edit With Sublime Text"
hkcr,"*\\shell\\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0"
hkcr,"*\\shell\\SublimeText3\\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%*"

摘译自 robots.thoughtbot.com

launchctl 命令加载,卸载开机自动运行的服务,在 OS X 中,服务本身存储在 .plist 文件中(即 property list),这些文件的位置一般在 ~/Library/LaunchAgents/Library/LaunchAgents。可以使用 launchctl load $PATH_TO_LISTunload them with launchctl unload $PATH_TO_LIST 命令来加载/卸载他们。加载就是允许这个程序开机执行,卸载反之。

如果你使用 Homebrew 安装过 mysql 那么下面的安装后提示你可能比较熟悉

To have launchd start mysql at login:
   ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
@maboloshi
maboloshi / rst2md.sh
Last active March 9, 2019 11:31 — forked from zorbax/rst2md.sh
[reStructuredText to Markdown] #shell
for i in $(ls *rst)
do
filename="${i%.*}"
echo "Converting $i to $filename.md"
pandoc "$i" -f rst -t gfm -o "$filename.md"
done
@maboloshi
maboloshi / mega-dl.sh
Last active March 15, 2019 00:55 — forked from KenMacD/mega-dl.sh
[Download MEGA files from command-line] `./mega-dl.sh '<URL>' <file name>` (Note the single quotes around the URL, otherwise bash complains "event not found") #mega #shell
#!/bin/bash
# 原作者: t0n1
# 来自: http://hacktracking.blogspot.ca/2013/07/download-mega-files-from-command-line.html
#
# 修改: maboloshi
# <file_url>: https://mega.nz/#!<id>!<decyption Key>
url=$1
out_file="$2"
@maboloshi
maboloshi / sublime_hq_patches.md
Created March 13, 2021 03:22
Sublime HQ Patching Guide

Sublime Text 3

Sublime Text 3 (Build 3211)

Windows 32-bit

Reggable using Junk
Pre-Regged
@maboloshi
maboloshi / expand-collapse.user.js
Last active October 8, 2023 06:18 — forked from Jaace/expand-collapse.user.js
TamperMonkey Script: Gist expand / collapse files.
// Add a button to Collapse or Expand files in a Github Gist
//
// Install Tampermonkey and add this as a script
// ==UserScript==
// @name Github Gists: Expand / Collapse Files
// @namespace https://gist.github.com/Jaace/7b70d2bb19af63e10b144ed7d867eae0
// @version 0.1
// @description Add a button to expand or collapse files in github gists
// @author Jason Boyle

借助git快速批量转换CRLF到LF


换行符的差异

  • windows下每行结尾为回车+换行(CR+LF),即 \r\n
  • unix和macOS下每行结尾为换行LF,即 \n
  • classic macOS(最后一个版本为1999年发布的Mac OS 9,可忽略)下为回车,即 \r

设置jetbrain系IDE

settings > Editor > Code Style > Line Separator > unix and macOS (\n)