Skip to content

Instantly share code, notes, and snippets.

@ruanhao
ruanhao / douban_get_pic.py
Created February 22, 2018 14:49
豆瓣搜图
#!/usr/bin/env python3
import requests,re,json,html2text,sys,time
import os
from bs4 import BeautifulSoup
import time
from urllib.request import urlretrieve
url="https://www.douban.com/group/haixiuzu/"
#url="http://127.0.0.1:8080/"
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# Usage: $0 file1 file2 ...
# When this exits, exit all back ground process also.
trap 'kill $(jobs -p)' EXIT
# iterate through the each given file names,
for file in "$@"; do
@ruanhao
ruanhao / git_large_files_filter.sh
Created January 25, 2018 03:06
filter git large file
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
@ruanhao
ruanhao / create_spring_boot_project.sh
Last active February 15, 2018 09:16
Create Java Spring Project
# -*- coding: utf-8 -*-
#
# Description:
# Create Java Spring Project
artifactId=$1
spring init --groupId=haoru.cisco.com \
--artifactId=$artifactId \
--java-version=1.8 \
@ruanhao
ruanhao / search.sh
Last active November 15, 2017 05:49
search text with multiple patterns and highlights
function m () {
function _usage ()
{
echo "usage: COMMAND [-inHRp] -p<pattern1> -p<pattern2> <filename>";
echo "-i : ignore case";
echo "-n : show line number";
echo "-H : show filename";
echo "-h : show header";
echo "-p : specify pattern";
echo "-R : search recursively"