Skip to content

Instantly share code, notes, and snippets.

View lanrion's full-sized avatar
🎯
Focusing

lanrion lanrion

🎯
Focusing
  • guǎng zhōu
View GitHub Profile
@lanrion
lanrion / gist:9826458
Last active March 24, 2024 07:10
ubuntu上安装 五笔输入法

基于 IBus 框架

 1、安裝IBus框架:

  在终端中输入:

         sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4

  有些版本自带了此输入法框架,则不需要安装。
@lanrion
lanrion / gist:9479631
Last active December 5, 2023 08:20
浅析微信信息信息接收与信息回复

微信的信息接收与回复,两者是独立的。

信息接收

共同点在于:都有 ToUserName,FromUserName,CreateTime,MsgType, 这四个字段。

在信息接收方面,分为“普通消息”、“事件推送”,“语音识别结果(微信用户发送语音,微信服务器翻译成文本,只不过比语音消息多一个识别结果字段:Recognition)”。

  • 文本消息(通过“Content”关键字来获取文本内容,这点比较重要,也是使用比较多的场合)
  • 图片消息
@lanrion
lanrion / gist:3384bef6989a6196bdc4
Last active August 2, 2020 01:59
git submodule 的使用

git submodule 的使用

更新submodule的代码

  • 进入主项目,git pull
  • git submodule update

提交submodule的代码

  • 切换到submodule master分支,add, commit, push
@lanrion
lanrion / hexstring.js
Created March 23, 2020 13:52 — forked from tauzen/hexstring.js
Hex string to byte and other way round conversion functions.
function byteToHexString(uint8arr) {
if (!uint8arr) {
return '';
}
var hexStr = '';
for (var i = 0; i < uint8arr.length; i++) {
var hex = (uint8arr[i] & 0xff).toString(16);
hex = (hex.length === 1) ? '0' + hex : hex;
hexStr += hex;
https://apple.stackexchange.com/questions/171530/how-do-i-downgrade-node-or-install-a-specific-previous-version-using-homebrew
@lanrion
lanrion / gist:11104201
Created April 20, 2014 03:26
git remove remote cache file
git rm --cached asd
git commit -m "the file asd is gone from the repository"
@lanrion
lanrion / gist:02004e0108db405b1c72
Created September 15, 2014 08:04
svn2git usage

使用的插件如下:https://github.com/nirvdrum/svn2git

检查项目SVN中有没有使用 trunk, branches, tags ,如果都没有所以在fetch时指定 "--notrunk --notags --nobranches " 即可。

下面命令是转换 weixin_test的使用命令:

svn2git svn://denght@192.168.0.30/lanrion/website/weixin_test --username denght --notrunk --no-minimize-url --notags --nobranches --verbose
@lanrion
lanrion / gist:64095dd94150520ff9ac
Created August 11, 2014 03:51
git sync remote tags

git fetch --prune --tags

@lanrion
lanrion / status_header_setter
Created September 14, 2016 09:41 — forked from ktkaushik/status_header_setter
Set HTTP status headers with respond_with( object ) in rails.
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok