Skip to content

Instantly share code, notes, and snippets.

@songpp
songpp / startup.sh
Created September 9, 2016 09:43
java app startup script template
#!/usr/bin/env bash
# project artifact: ${project.artifact}-${project.version}.jar
# startup script of core
# 需要一个参数: 启动的配置文件名称,这个配置文件必须在当前classpath下
# 启动示例:
# startup.sh 2551.conf 0 0 listening port specified in config file, disable jmx
# startup.sh 2551.conf 3551 listening port is 3551 , disable jmx
# startup.sh my.conf 5555 8555 listening port is 5555, jmx port is 8555
# startup.sh 3551.conf 0 4444 listening port specified in config file, jmx port is 4444
echo 1,2,4,5,6,9 a,b,d,e,f,i | gawk '{
split($1, Number, ",");
split($2, Letter, ",");
fourIdx = -1;
nineIdx = -1;
for(x = 1; x <= length(Number); x++) {
if(Number[x] == 4) {
fourIdx = x;
}
if(Number[x] == 9) {
@songpp
songpp / commands.sh
Created July 30, 2016 08:29
git commands
git log --author="${user}" --pretty=tformat: --numstat | egrep '[^DAO]\.java' |gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
@songpp
songpp / Sublime Text 3 Build 3103 License Key - CRACK
Created June 26, 2016 17:41
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@songpp
songpp / introrx.md
Created June 26, 2016 17:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@songpp
songpp / The Technical Interview Cheat Sheet.md
Created June 26, 2016 17:34 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@songpp
songpp / snippet.hs
Created December 4, 2015 06:26
state monad
listDirs :: FilePath -> IO [String]
listDirs = liftM (filter notDots) . getDirectoryContents
where notDots p = p /= "." && p /= ".."
countEntries :: FilePath -> WriterT [(FilePath, Int)] IO ()
countEntries path = do
contents <- liftIO . listDirs $ path
tell [(path, length contents)]
@songpp
songpp / jvm-parameters
Created July 7, 2015 09:04
print jvm default parameters
java -XX:+PrintFlagsFinal -version
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by [email protected]
# modified by aconway@[redacted] - handle diffs that introduce new files
# modified by [email protected] - fixes diffs that introduce new files
# modified by [email protected] - fix sed syntax issue in OS X
# modified by songpengpeng - fix sed newline issue in OS X
#
# Generate an SVN-compatible diff against the tip of the tracking branch
@songpp
songpp / hsdev_scan.sh
Created February 17, 2015 07:10
haskell hsdev utilities
#! /bin/bash
THIS_PROJECT=$(cd "$(dirname "$0")"; pwd);
THIS_PROJECT_DIR_NAME=$(basename "$THIS_PROJECT");
MY_SANDBOX=~/tools/dev-sandbox/;
set -x;
exec 3>&1
rescan() {
hsdev start --port 4567 --cache "$THIS_PROJECT/.hsdev" >&3;