Skip to content

Instantly share code, notes, and snippets.

View hbprotoss's full-sized avatar
🎯
Focusing

hbprotoss

🎯
Focusing
View GitHub Profile
@hbprotoss
hbprotoss / kill_double_typing.cpp
Last active January 25, 2021 03:58
解决mac键盘双击问题
// alterkeys.c
// http://osxbook.com
//
// You need superuser privileges to create the event tap, unless accessibility
// is enabled. To do so, select the "Enable access for assistive devices"
// checkbox in the Universal Access system preference pane.
// modified by SF-Zhou
// To: Kill Double Typing on MacBook
// Complile: g++ -O2 -Wall -o kill_double_typing kill_double_typing.cpp -framework ApplicationServices
@hbprotoss
hbprotoss / Google protobuf installation on Mac
Created March 9, 2020 11:48 — forked from rajkrrsingh/Google protobuf installation on Mac
Steps to Install google protobuf on Mac
$wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
$tar xvf protobuf-2.5.0.tar.bz2
$cd protobuf-2.5.0
$./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi"
$make -j 4
$sudo make install
$protoc --version
# 单条
100w
C++
SET: 97837.79 requests per second
GET: 99830.29 requests per second
INCR: 98941.33 requests per second
LPUSH: 99088.39 requests per second
RPUSH: 99019.70 requests per second
@hbprotoss
hbprotoss / ffmpeg.md
Created September 17, 2019 11:40 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@hbprotoss
hbprotoss / rinkeby
Last active April 12, 2018 01:32
rinkeby
0xa49E3733b98e34F2ad30559200f9c5D86f806a12
@hbprotoss
hbprotoss / 词性标记.md
Created September 24, 2017 10:00 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@hbprotoss
hbprotoss / qq_message_xml.md
Created June 27, 2017 09:03 — forked from koukuko/qq_message_xml.md
发送XML消息的格式

QQ的XML消息格式整理

QQ可以使用xml的方式发送消息,以下为了方便描述统称为卡片。

发送方式

通过机器人的API进行发送xml即可,但是如果选择发送xml,那么其他如[image=xxx][@xxx]这些命令就不可使用了。整个消息只有XML。

基本结构

xml主要由msg,item,source这3部分组成

<?xml version='1.0' encoding='utf-8' standalone='yes'?>
#!/bin/sh
IPT=/sbin/iptables
LOCAL_IFACE=eth0
INET_IFACE=wlan0
INET_ADDRESS=192.168.21.231
# Flush the tables
$IPT -F INPUT
$IPT -F OUTPUT
$IPT -F FORWARD
@hbprotoss
hbprotoss / mkcluster.sh
Last active April 14, 2016 08:39
redis cluster
#!/bin/bash
START_PORT=7100
COUNT=6
for port in $(seq $START_PORT `expr $START_PORT + $COUNT - 1`)
do
dir="`pwd`/$port"
mkdir $dir
conf_file="$dir/$port.conf"
@hbprotoss
hbprotoss / 二手车.java
Created December 20, 2013 13:32
抓取58代码片段
Document doc = Jsoups.getDocByUrl(url);
TPGoods goods = new TPGoods();
goods.setId(Long.valueOf(url.substring(url.lastIndexOf("/") + 1, url.lastIndexOf("x.shtml"))));
goods.setRealUrl(url);
/* main */
Element main = doc.getElementById("main").getElementsByTag("div").first();
Element title = main.select("h1").first();
goods.setTitle(title.html());
Element time = main.select("li.time").first();