Skip to content

Instantly share code, notes, and snippets.

View Youmoo's full-sized avatar

youmoo Youmoo

  • 浙江杭州
View GitHub Profile
#!/usr/bin/env node
var program = require('commander');
var request = require('request');
var chalk = require('chalk');
program
.version('0.0.1')
.usage('[options] <keywords>')
.option('-o, --owner [name]', 'Filter by the repositories owner')
@Youmoo
Youmoo / kafka.md
Last active August 29, 2015 14:02

kafka quick start

start zookeeper

bin/zookeeper-server-start.sh config/zookeeper.properties

start kafka

bin/kafka-server-start.sh config/server.properties
@Youmoo
Youmoo / pom.xml
Last active August 29, 2015 14:06 — forked from cxxr/pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>root-pom</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Root POM</name>
<url>http://git.example.com/rootpom.git</url>
@Youmoo
Youmoo / pom.xml
Last active August 29, 2015 14:06 — forked from gordonad/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gordondickens.sample</groupId>
<artifactId>sample-parent</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
public class Volatility {
static int NEXT_IN_LINE = 0;
public static void main(String[] args) throws Exception {
new CustomerInLine().start();
new Queue().start();
}
static class CustomerInLine extends Thread {
var array_like = {};
array_like[ 0 ] = "test 0";
array_like[ 1 ] = "test 1";
array_like[ 2 ] = "test 2";
array_like[ 3 ] = "test 3";
array_like.length = 4;
array_like.splice = [].splice;
@Youmoo
Youmoo / if-else.md
Created November 12, 2014 10:57
if-else in 2 flavors

两种风格的if-else比较

flavor 1:

var cond=true;
if(cond){
    // your logic
}else{
    // your logic
}
@Youmoo
Youmoo / post-merge
Created October 27, 2015 12:30 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"

Keybase proof

I hereby claim:

  • I am youmoo on github.
  • I am youmoo (https://keybase.io/youmoo) on keybase.
  • I have a public key ASAJAXL8jWuz6cgTM6fmKGMpGMZHaSpYcaSPNfo-XAf5vwo

To claim this, I am signing this object:

@Youmoo
Youmoo / README.md
Last active November 28, 2016 09:32
favorite words && 喜欢的单词

收集一些自己喜欢的单词

// 格式化为es批量插入格式
[...$$('[itemprop=text] p')]
  .map(v=>v.textContent)
  .slice(1)
  .map(v=>`{"create":{"_index":"ym","_type":"words","_id":"${v}"}}
{ "word":"${v}", "sentence":"", "def":"", "created":"2016-11-28"}`).join('\n')