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.
  • 09:43 (UTC +08:00)
View GitHub Profile
@maboloshi
maboloshi / Reg2Bat.vbs
Last active October 21, 2022 09:22
[Reg2Bat]一个将reg格式的注册表文件 转成bat文件的vbs脚本原作者:http://slore.blogbus.com/logs/52627038.html,修改作者:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=386057
'------------------------------------------------------------------------------
'名称:Reg2Bat_By Slore(生成同名bat文件,支持XP、WIN7、WIN7X64).vbs
'功能:REG文件转换为同名的BAT、CMD文件。
'原文http://slore.blogbus.com/logs/52627038.html
' REG命令功能有限,仅支持常用类型。
' (REG_SZ、REG_DWORD、REG_BINARY、
' REG_EXPAND_SZ、REG_MULTI_SZ)
'
' By Slore 【修改by 代码飞扬】
' 更新于:2017年2月16日
@maboloshi
maboloshi / Download a single file from a private GitHub repo.md
Created November 2, 2019 10:36
[Download a single file from a private GitHub repo] #github #curl

Download a single file from a private GitHub repo.

Relying on basic authentication

#
#依靠基本身份验证从github企业获取原始内容的单一代码。
#无需创建访问令牌并将其合并到url中。
#
#
#填空:
@maboloshi
maboloshi / png2icons.sh
Created February 15, 2019 11:46
[快速生成 Mac App icns 图标 -- PNG2ICONS ] 需要准备一个 1024x1024 的png图片, 使用`png2icons.sh xxx.png`. 出处:http://www.jianshu.com/p/e74047f7cc91
#!/bin/bash
iconset_dir=tmp-$RANDOM.iconset
mkdir $iconset_dir
## 全部拷贝到命令行回车执行,执行结束之后去tmp.iconset查看十张图片是否生成好
sips -z 16 16 $1 --out $iconset_dir/icon_16x16.png &> /dev/null
sips -z 32 32 $1 --out $iconset_dir/icon_16x16@2x.png &> /dev/null
sips -z 32 32 $1 --out $iconset_dir/icon_32x32.png &> /dev/null
sips -z 64 64 $1 --out $iconset_dir/icon_32x32@2x.png &> /dev/null
@maboloshi
maboloshi / locals.js
Created February 11, 2019 05:18
[GitHub 汉化插件] 翻译数据库文件 from https://github.com/SickleSky/github-hans
var I18N = {};
I18N.conf = {
/**
* 要翻译的页面正则
*/
rePageClass: /\b(vis-public|page-(dashboard|profile|account|new-repo|create-org)|homepage|signup|session-authentication|oauth)\b/,
/**
* 匹配 pathname 页面的正则
@maboloshi
maboloshi / remove_ABC_Input.sh
Last active June 27, 2023 02:37
[mac 删除默认ABC输入法] mac默认ABC输入法,默认无法使用“系统偏好与设置”中删除。需要运行本脚本,运行后立即重启系统。生效修改
#!/bin/bash
cd ~/Library/Preferences/
cp com.apple.HIToolbox.plist com.apple.HIToolbox.plist.bak
alias plistbuddy='/usr/libexec/PlistBuddy'
dict=$(plistbuddy -c "Print AppleEnabledInputSources" com.apple.HIToolbox.plist| grep -c "Dict")
for i in {0..$dict};do
if [ "$(plistbuddy -c "Print AppleEnabledInputSources:$i:KeyboardLayout\ Name" com.apple.HIToolbox.plist 2>/dev/null)" = "ABC" ]
@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
@maboloshi
maboloshi / create_ref_github_api.ps1
Created December 8, 2023 03:44
通过 GitHub REST API 创建远程分支 (Powershell 原生实现)
function create_ref {
param (
[Parameter(Mandatory = $true)]
[String]$Token,
[Parameter(Mandatory = $true)]
[String]$RepoNwo,
[Parameter(Mandatory = $true)]
[String]$Ref,

摘译自 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 / README.MD
Last active February 2, 2024 14:51
[小米9 刷入欧洲版MIUI for macOS]

小米9 刷欧洲版 MIUI 固件及适当的本土化修复

本教程不保证它的权威性和正确性,也不对任何实践中的错误、数据丢失等问题负责!
本教程平台为 macOS, 其他系统请酌情参考

更新说明

@ 2020/8/29

  1. 添加"介绍"
  2. 更新 TWRP 信息