Skip to content

Instantly share code, notes, and snippets.

View oizhaolei's full-sized avatar
🏠
Working from home

lei oizhaolei

🏠
Working from home
View GitHub Profile
@buzztaiki
buzztaiki / rust_source_based_coverage.md
Last active January 5, 2025 04:14
Rust の Source-based code coverage をお手軽に使う

Rust の Source-based code coverage をお手軽に使う

1.60 で Source-based code coverage が安定化した (stable で使えるようになった)。

どうやって使うのかといった話は リリースノート に書いてある通り。なんだけど、ちょっと面倒くさい。

簡単に使うには https://github.com/taiki-e/cargo-llvm-cov の力を借りる。

まずは、llvm-tools-previewcargo-llvm-cov を入れておく:

@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active March 7, 2025 05:00
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@janryWang
janryWang / OssFilesField
Created April 11, 2015 10:21
keystone.js与阿里云OSS结合,支持多文件上传
module.exports = require('../localfiles/LocalFilesField');
@mocobeta
mocobeta / HelloKuromoji.java
Last active December 21, 2020 05:33
Hello Lucene! (5.0)
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.ja.JapaneseTokenizer;
import org.apache.lucene.analysis.ja.tokenattributes.PartOfSpeechAttribute;
import org.apache.lucene.analysis.ja.tokenattributes.ReadingAttribute;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
import org.apache.lucene.analysis.util.CharArraySet;
@joeyAghion
joeyAghion / mongodb_collection_sizes.js
Last active June 4, 2025 10:23
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }