Skip to content

Instantly share code, notes, and snippets.

@zhgqthomas
zhgqthomas / make-pot.sh
Created May 20, 2021 09:31 — forked from UVLabs/make-pot.sh
Using WordPress makepot.php to generate pot file used for the internationalization of your plugin or theme.
#!/bin/bash
php path/to/makepot.php wp-plugin /path/to/your/plugin pluginname.pot
#php path/to/makepot.php wp-theme /path/to/your/theme themename.pot

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@zhgqthomas
zhgqthomas / openwrt.py
Created January 23, 2018 04:11
爬取 openwrt barrier_breaker 软件包源的 python 脚本
#!/usr/bin/env python
#coding=utf-8
#
# Openwrt Package Grabber
#
# Copyright (C) 2014 http://shuyz.com
#
import urllib2
import re
@zhgqthomas
zhgqthomas / ssr-install.sh
Created January 19, 2018 05:34
SSR 一键安装脚本
#!/bin/bash
[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script"; exit 1; }
install_ssr(){
clear
stty erase '^H' && read -p " API接口(mudbjson, sspanelv2, sspanelv3, sspanelv3ssr, glzjinmod, legendsockssr):" ssapi
stty erase '^H' && read -p " mysql服务器地址:" ssserver
stty erase '^H' && read -p " mysql服务器端口:" ssport
stty erase '^H' && read -p " mysql服务器用户名:" ssuser
stty erase '^H' && read -p " mysql服务器密码:" sspass
stty erase '^H' && read -p " mysql服务器数据库名:" ssdb
@zhgqthomas
zhgqthomas / wechat_developer_tool_response
Last active January 3, 2018 04:57
微信开发工具项目信息返回报文
{"baseresponse":{"errcode":0},"attr_list":[{"appid":"wx6ac3f5090a6b99c5","Network":{"RequestDomain":["https:\/\/wxardm.weixin.qq.com","https:\/\/mp.weixin.qq.com","https:\/\/badjs.weixinbridge.com"],"WsRequestDomain":[],"UploadDomain":[],"DownloadDomain":[],"BizDomain":[]},"Setting":{"MaxLocalstorageSize":10,"MaxCodeSize":4,"MaxWebviewDepth":5,"MaxBackgroundLifespan":300,"MaxRequestConcurrent":10,"MaxUploadConcurrent":10,"MaxDownloadConcurrent":10,"MaxFileStorageSize":10,"ExpiresAtList":432000,"BackgroundNetworkInterruptedTimeout":300,"CanKeepAliveByAudioPlay":1,"LifeSpanBeforeSuspend":5,"LifeSpanAfterSuspend":300,"MaxWebsocketConnect":2,"ExpendedMaxWebviewDepth":10,"ActualWebviewDepth":5,"WebsocketSkipPortCheck":1,"MaxSubpackageSubCodeSize":2,"MaxSubpackageFullCodeSize":4,"MaxWorkerConcurrent":1},"appname":"小游戏开发辅助","appicon_url":"http:\/\/wx.qlogo.cn\/mmhead\/Q3auHgzwzM6ZNOtaaZLvrBYajKmCFia9icUxgMFpVS5EB68YfibibjUPgw","jsapi_list":[{"name":"openLink","state":0},{"name":"showKeyboard","state":1},{"name":"ins
@zhgqthomas
zhgqthomas / htmldecode.js
Created December 8, 2017 07:35
decode HTML Entity
function htmlDecode(str) {
// 有 x 则表示是16进制,$1 就是匹配是否有 x,$2 就是匹配出的第二个括号捕获到的内容,将 $2 以对应进制表示转换
str = str.replace(/&#(x)?(\w+);/g, function($, $1, $2) {
return String.fromCharCode(parseInt($2, $1? 16: 10));
});
return str;
}
@zhgqthomas
zhgqthomas / ShakeDetector.java
Created October 18, 2017 02:16
Shake algorithm from react native
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.react.common;
@zhgqthomas
zhgqthomas / private.xml
Created September 5, 2017 05:00 — forked from KeeperPat/private.xml
Karabiner Configuration to Remap Surface Ergonomic Keyboard Alt and Windows Keys for Mac
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>Microsoft</vendorname>
<vendorid>0x045e</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>SurfaceErgonomic</productname>
<productid>0x0817</productid>
@zhgqthomas
zhgqthomas / autodraw-cloud.js
Last active June 30, 2017 15:07
Auto Draw 小程序版 LeanCloud 代理脚本
const https = require('https');
AV.Cloud.define('stencils', function (request, response) {
const options = {
hostname: 'www.autodraw.com',
path: '/assets/stencils.json',
port: 443,
method: 'GET',
headers: {
@zhgqthomas
zhgqthomas / LogUtils.java
Last active June 15, 2017 03:16
Log util for Android
package com.zhgqthomas.rxjava.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.util.Log;
public class LogUtils {
private static String LOG_PREFIX = "github_";