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 / regex.bash
Created July 30, 2015 09:13
a example use bash regex
cd ${WORKSPACE}/mbn
mbn_array=( $(ls *.mbn) )
for mbn_name in ${mbn_array[*]}; do
if ! [[ $mbn_name =~ Y.*\.mbn ]]; then
printf "rm -rf %s \n" "${mbn_name}" >> lftp.cmd
printf "put -c %s \n" "${mbn_name}" >> lftp.cmd
fi
done
@qinshulei
qinshulei / emoji.md
Created July 31, 2015 08:51
all emoji

😀 😁 😂 😃 😄 😅 😆 😇 😈 👿

@qinshulei
qinshulei / console.rb
Last active August 26, 2016 09:09
mark to delete
#!/usr/bin/env ruby
require "bundler/setup"
require_relative "lib/my_project"
require "sequel"
require "irb"
def config
return @config if @config
config_path = File.expand_path("../config/application.yml", __FILE__)
@qinshulei
qinshulei / history_no.zsh
Created August 31, 2015 08:29
show history no in zsh
# Prompt format: \n # HISTORY_NMUBER USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
PROMPT="
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
%{$fg[red]%}%h%{$reset_color%} \
%{$fg[cyan]%}%n \
%{$fg[white]%}at \
%{$fg[green]%}$(box_name) \
%{$fg[white]%}in \
%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
${hg_info}\
@qinshulei
qinshulei / gist:5f7bd4fc2449885ac7a6
Last active August 26, 2016 09:08
mark to delete
We couldn’t find that file to show.
@qinshulei
qinshulei / ConvertAndroidVectorDrawable2png.md
Last active June 9, 2025 17:00
Convert Android VectorDrawable to png

转换方法:

  1. Convert Android VectorDrawable to SVG:

使用附件中的java程序。命令如下:

cp Vector2Svg.java path/to/xml_dir
javac Vector2Svg.java
java Vector2Svg ./*.xml
mkdir svg_dir
@qinshulei
qinshulei / get-all-patchs-by-grep-and-order-it.bash
Created December 7, 2015 06:55
get all patchs by grep and order it
output_dir=/home/qinshulei/gerrit_projects/jenkins/patch_out;num=1000;for i in $(git log --no-merges --grep=add --format="%h") ; do mkdir -p $output_dir; num=$((num - 1)); git format-patch -1 $i -o $output_dir --start-number $num;cd $output_dir;touch patch-commits-map.txt;temp=$(ls *$num-*);mv ${temp} ${temp%%-*}-${i}-${temp#*-};echo "$num $i">>patch-commits-map.txt; cd -;done;sort -n $output_dir/patch-commits-map.txt > $output_dir/patch-commits-map.txt
@qinshulei
qinshulei / repo_jump.bash
Created December 7, 2015 12:32
repo jump contains repogo and repofzf two functions
#!/bin/bash
function repogo(){
project_name=$1
out=$(repo list | grep "${project_name}")
if [ -n ${out} ];then
project_path=$(echo "${out}" | awk '{print $1}')
echo "cd ${project_path}"
cd "${project_path}"
fi
@qinshulei
qinshulei / 0x8B1F
Created December 17, 2015 13:51 — forked from zealic/Email
Please use CAPTCHA as additional message
H4sIAAAAAAAAA6VRybKiQBC88xXvPofpBhE4zKEaBRFRG2xAbjQNiGwaLghfPxgx
fzB5qIrKyKglK1WypZrJhraQNVQIZCh5rqcGL/Q01wTiPylKkY6KhZwvC6xwJZXF
nJUCaQoyVCF+loYuVJxiQ+gplnGWqzpeGIbQuIbwcqlLf/4TUsU+6WmAvXnp3fUK
SgoNwFAfPAADvrCSxj+IKGGnDsxfmJzQlwznQHb+b09KYmickXxEFE7Cbt688148
oq5ZeVfH2pRQgmOW/WdXEZbarDxH6iTkcHQ2/tuxPzcpadljLjwoP5i3jZzE2ykJ
hq+wduxwD3HtEApTGqndcejHuZHDlazkkfXKA9JJWWs9s5G8k4pMXAkfs2iaRSVF
xoEii7lr/yJs9vK77ZuzZ5PH4p21tHdqYYcjmaRkXimGHkhA6nNcV26g2lzZPs/x
V4T3iU1nbiivQ3KYJ3fnryu2/+SBc3MjUkhWRVw+0GJlkpANN58FZJO1Bs5Wveve
gUBFXiLCVeSLG1TO3X3To3n1Ri8gR+9EsbQ3iemdiAWr9RHM+u7WtR2Ws4l20843
rmhIGEUXkgGvrXLoaJA9nLV1YFhYrLr4khfU/Y7C6AYIPIX6awr/MP/4L1driBiI
@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.