Skip to content

Instantly share code, notes, and snippets.

View qinshulei's full-sized avatar
🎯
Focusing

Qin Shulei qinshulei

🎯
Focusing
View GitHub Profile
@qinshulei
qinshulei / parallel workflow
Last active August 26, 2016 09:02 — forked from michaelneale/parallel workflow
jenkins pipeline parallel example
stage "preparation"
node {
parallel (
phase1: { sh "echo p1; echo phase1" },
phase2: { sh "echo p2; echo phase2" }
)
sh "echo 42 > data"
stash includes: '*', name: 'binary'
@qinshulei
qinshulei / create_branch_in_pure_git.sh
Created June 27, 2016 08:00
create_branch_in_pure_git.sh
#!/bin/bash
for i in $(ls | grep git);do
echo $i;
cd $i;
git show-ref | grep remotes | while read LINE;do
echo $LINE
version=$(echo ${LINE} | awk 'BEGIN { FS = " " } ; { print $1 }');
branch_name=$(echo ${LINE} | awk 'BEGIN { FS = " " } ; { print $2 }');
echo "version : ""${version}";
@qinshulei
qinshulei / ginger-api.el
Created June 3, 2016 10:28 — forked from syohex/ginger-api.el
ginger API from Emacs
(require 'request) ;; https://github.com/tkf/emacs-request
(require 'json)
(defvar ginger-end-point
"http://services.gingersoftware.com/Ginger/correct/json/GingerTheText" )
;;;###autoload
(defun ginger-region (beg end)
(interactive "r")
(lexical-let* ((text (buffer-substring-no-properties beg end))
@qinshulei
qinshulei / .bashrc
Created May 30, 2016 07:02
Some changes into .bashrc to se git on path and to use tmux better
# GIT
# Download this file https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh to ~/.git-prompt.sh
source ~/.git-prompt.sh
export PS1='\[\e[1;33m\]'$PS1'\[\e[1;32m\]$(__git_ps1 "(%s) ")\[\e[m\]'
# TMUX
export TERM=xterm-256color
@qinshulei
qinshulei / SimpleHTTPServerWithUpload.py
Created April 12, 2016 07:24 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@qinshulei
qinshulei / git aliases.sh
Created April 6, 2016 06:53 — forked from tj/git aliases.sh
Some helpful git aliases
alias gd="git diff"
alias gc="git clone"
alias ga="git add"
alias gbd="git branch -D"
alias gst="git status"
alias gca="git commit -a -m"
alias gpt="git push --tags"
alias gp="git push"
alias gpr="git pull-request"
alias grh="git reset --hard"
@qinshulei
qinshulei / git_merge_config.bash
Created January 21, 2016 02:51
merge setting
# 3-way merge
git config --global merge.conflictstyle diff3
# patience diff
git config --global diff.algorithm histogram
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
@qinshulei
qinshulei / filter-row.js
Created January 15, 2016 04:44
filter the table row content in web page
$(document).ready(function() {
$("#xwikicontent tr").each(function(){
var content = $(this).text();
if (content.indexOf("8992") < 0){
$(this).css('display', 'none');
} else {
$(this).css('display', '');
}
});
});
@qinshulei
qinshulei / eclipse_checkstyle560_android.xml
Created January 8, 2016 06:05 — forked from fredgrott/eclipse_checkstyle560_android.xml
eclipse checkstyle 5.6.0 forandroid
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: Android Checks (Eclipse)
Description:
Slightly modified version of Sun Checks that better matches the default code formatter setting of Eclipse.