Skip to content

Instantly share code, notes, and snippets.

View quwubin's full-sized avatar

Wubin Qu quwubin

View GitHub Profile
@quwubin
quwubin / get_cpu_usage
Created March 25, 2014 08:17
Get CPU usage
#!/usr/bin/bash
# Give all CPUs usage percent
ps fuxw | awk '{ if ($3 ~ /^[0-9]/) {SUM +=$3}} END {print SUM"%"}'
import sys
import numpy
from nltk.cluster import KMeansClusterer, GAAClusterer, euclidean_distance
import nltk.corpus
from nltk import decorators
import nltk.stem
stemmer_func = nltk.stem.EnglishStemmer().stem
stopwords = set(nltk.corpus.stopwords.words('english'))
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@quwubin
quwubin / .vimrc
Created May 16, 2014 06:55
.vimrc
" ~./vimrc
" Kompatibilitätsmodus abschalten
set nocompatible
" Im GUI-Modus Consolas Zeichensatz setzen und fruity Farbschema benutzen.
if has("gui_running")
colorscheme fruity
set guifont=Consolas\ 12
else
@quwubin
quwubin / fastaParser.go
Created September 18, 2014 02:28
A fasta parser in go lang
package main
import (
"bytes"
"fmt"
"log"
"os"
"strings"
"bufio"
"io"
@quwubin
quwubin / cat_all
Created March 22, 2015 14:58
List all the files with suffix .csv (e.g.) in directory "./" (e.g.)
#!/usr/bin/env ruby
require "find"
def get_opts
require 'trollop'
opts = Trollop::options do
version "#{File.basename($PROGRAM_NAME)} 1.0.0 (c) 2014 Wubin Qu"
banner <<-EOS