Skip to content

Instantly share code, notes, and snippets.

#监控咸鱼商品.sh
#http://www.hi-pda.com/forum/viewthread.php?tid=1735219&extra=page%3D1
#监控商品的具体型号,标题和顶楼内容中符合其中的一项就会提醒:
keyword='newifi'
#价格,低于将提醒
pricelimit=81
#输出到html文件
alertfile=taobao.htm
@cdpath
cdpath / cvimConfig
Created January 2, 2016 04:10
cVim config
map h gT
map l gt
map w gT
map e gt
unmap d
map d x
unmap ;
map ; :
set nohud
set nosmoothscroll
@cdpath
cdpath / mvvenv.sh
Created February 26, 2016 05:27
mv virtualenv properly
#!/usr/bin/env bash
# Usage: mvvenv.sh oldpath newpath
oldpath=$(realpath $1)
newpath=$(realpath $2)
# binpath=$(find oldpath -type d -name bin)
# tmp=${binpath%/*}
# venvname=${tmp##*/}
venvname=${VIRTUAL_ENV##*/}
oldvenvpath=$oldpath/$venvname
newvenvpath=$newpath/$venvname
@cdpath
cdpath / keymap.cson
Created March 4, 2016 05:33
自定义 Atom key-bingdin
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@cdpath
cdpath / bash_template.sh
Created March 9, 2016 07:40
bash 模板
#!/bin/bash
echo "OPTIND starts at $OPTIND"
while getopts ":pq:" optname
do
case "$optname" in
"p")
echo "Option $optname is specified"
;;
"q")
echo "Option $optname has value $OPTARG"
@cdpath
cdpath / backcard.html
Last active August 6, 2016 05:29
anki template
<p class='word'> {{word}}</p>
<p>{{word Audio}}</p>
<p class='sentence'>{{examples_en}}</p>
<hr id=answer>
<p class='definition'>{{explanation_cn}}</p>
<p class='sentence'>{{examples_cn}}</p>
<p class='info'>★ {{phonetic symbol}} / <a href='eudic://dict//{{word}}'>Eudic</a> / {{#how_to_mem_zhuji3000}}{{how_to_mem_zhuji3000}}{{/how_to_mem_zhuji3000}}{{^how_to_mem_zhuji3000}} {{how_to_mem_bzsdbdc}}{{/how_to_mem_zhuji3000}}</p>
@cdpath
cdpath / util
Last active October 18, 2016 08:19
handlers for hubot-script-shellcmd
#!/usr/bin/env bash
set -o errexit
cmd_type=$1
do_top() {
top -b -n2 -p 1 | fgrep "Cpu(s)" | tail -1 | awk -F'id,' -v prefix="$prefix" '{ split($1, vs, ","); v=vs[length(vs)]; sub("%", "", v); printf "%s%.1f%%\n", prefix, 100 - v }'
}
do_who() {
who | awk '{print $1}'
@cdpath
cdpath / kinlde.bat
Created October 25, 2016 15:55
remove kindle unnecessary dirs
@echo off
for /f "delims= tokens=1*" %%a in ('dir /b *.sdr') do (
if not exist "%%~na.mobi" (
if not exist "%%~na.azw*" (
if not exist "%%~na.txt" (
if not exist "%%~na.pdf" (
rd /s/q %%a
)
)
)
@cdpath
cdpath / kinlde.bat
Last active February 2, 2018 05:42
clean up extras folders under documents
@echo off
for /f "delims= tokens=1*" %%a in ('dir /b *.sdr') do (
if not exist "%%~na.mobi" (
if not exist "%%~na.azw*" (
if not exist "%%~na.txt" (
if not exist "%%~na.pdf" (
rd /s/q %%a
)
)
)
@cdpath
cdpath / GitHub-Forking.md
Created November 10, 2016 06:11 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, when I started going through the process of forking and issuing pull requests, I had some trouble figuring out the proper method for doing so and made quite a few mistakes along the way. I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your