Skip to content

Instantly share code, notes, and snippets.

View noodles-v6's full-sized avatar

noodles noodles-v6

View GitHub Profile
@noodles-v6
noodles-v6 / JdbcType.java
Created April 12, 2016 07:37
Mybatis.JdbcType
/**
* Copyright 2009-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@noodles-v6
noodles-v6 / kafka.md
Last active August 29, 2015 14:14 — forked from ashrithr/kafka.md

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
@noodles-v6
noodles-v6 / gist:8909420
Created February 10, 2014 02:35
喜欢你-Beyond(歌词的粤语拼音)
sei yu dai fong sa tou fong fen dei gai dou
细 雨 带 风 湿 透 黄 昏 的 街 道
mu hei yu sui suang an mou gu dei yang mang
抹 去 雨 水 双 眼 无 故 地 仰 望
mang hang gu dan dei mai deng
望 向 孤 单 的 晚 灯
si na sang gan dei gei yi
是 那 伤 感 的 记 忆
zai ci fan hei sen lei mou sou dei si ni
再 次 泛 起 心 里 无 数 的 思 念
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
@noodles-v6
noodles-v6 / top.sh
Created August 18, 2013 12:48 — forked from sdslnmd/top.sh
#!/bin/bash
redEcho()
{
echo -e "\033[1;31m$@\033[0m"
}
pid=`pgrep java`
uuid=`date +%s`_${RANDOM}_$$
jstackFile=/tmp/${uuid}_${pid}
sudo -u tomcat jstack ${pid} > ${jstackFile}
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue
cd /usr/local
mkdir redis-latest-install
cd redis-latest-install
curl http://redis.googlecode.com/files/redis-2.6.13.tar.gz | tar xz --strip-components=1
#In order to install Redis binaries into /usr/local/bin just use:
#
# % make install
#
#You can use "make PREFIX=/some/other/directory install" if you wish to use a
#echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
#. ~/.bashrc
#mkdir ~/local
#mkdir ~/node-latest-install
#cd ~/node-latest-install
#curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
#./configure --prefix=~/local
#make install # ok, fine, this step probably takes more than 30 seconds...
#curl https://npmjs.org/install.sh | sh
@noodles-v6
noodles-v6 / svn_check_status.bat
Last active December 17, 2015 07:39
svn check status
@rem = '--*-Perl-*--
@echo off
perl -x -S %0 %*
goto endofperl
@rem -- BEGIN PERL -- ';
#!perl
my @ignore_list = qw/