Skip to content

Instantly share code, notes, and snippets.

View upbit's full-sized avatar

Zhou Hao upbit

  • China
View GitHub Profile
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@thynson
thynson / k_from_n.js
Last active August 29, 2015 13:57
Get random k numbers from an iterator of arbitrary N length array where N is unknown. (pseudo code)
function(iter, k) {
var array = [];
var count = 0;
for (var val = iter(); val !== undefined; val = iter()) {
count ++;
if (array.length < k)
array.push_back(val);
else {
var luck = rand() % count;
if (luck < k) {
@luw2007
luw2007 / 词性标记.md
Last active March 18, 2024 06:36
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

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

ICTPOS3.0词性标记集

n 名词

nr 人名

## Name of the riak node
-name riak@127.0.0.1
## Cookie for distributed erlang. All nodes in the same cluster
## should use the same cookie or they will not be able to communicate.
-setcookie riak
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!)
##-heart
@rvagg
rvagg / README.md
Last active April 21, 2024 08:33
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@reyjrar
reyjrar / elasticsearch.yml
Last active May 12, 2023 11:58
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@andrzejsliwa
andrzejsliwa / cowboy_debug.erl
Last active August 26, 2016 07:30
erlang - cowboy debugging helper request/response
%% See LICENSE for licensing information.
-module(cowboy_debug).
-export([onrequest_hook/1]).
-export([onresponse_hook/4]).
onrequest_hook(Req) ->
Method = to_string(extract(cowboy_req:method(Req))),
Path = to_string(extract(cowboy_req:path(Req))),
Params = params_to_string(extract(cowboy_req:qs_vals(Req))),
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active April 2, 2024 20:18
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@kevsmith
kevsmith / example.erl
Created September 12, 2011 14:14
Example of gen_server template output
%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
%% @author Kevin Smith <kevin@opscode.com>
%% @copyright 2011 Opscode, Inc.
-module(example).
-behaviour(gen_server).
-export([start_link/0]).