This commit is contained in:
Rico Sta. Cruz 2014-10-07 15:52:58 +08:00
parent 070e89ffd5
commit 4df01578d3
3 changed files with 90 additions and 14 deletions

35
git-log-format.md Normal file
View File

@ -0,0 +1,35 @@
---
title: Git log format string
layout: default
---
git log --pretty="format: ..."
%H - commit hash
%h - commit hash, abbrew
%T - tree hash
%T - tree hash, abbrev
%P - parent hash
%p - parent hash, abbrew
%an - author
%aN - author, respecting mailmap
%ae - author email
%aE - author email, respending mailmap
%aD - date (rfc2882)
%ar - date (relative)
%at - date (unix timestamp)
%ai - date (iso8601)
%cn - committer name
%cN - committer name
%ce - committer email
%cE - committer email
%cd - committer date
%cD - committer date
%cr
%ct
%ci
%cd - ref names
%e - econding
%s - commit subject
%f - commit subject, filename style
%b - commit body

View File

@ -16,20 +16,12 @@ layout: default
brew edit git # Edit this formula
brew home git # Open homepage
### Stuff
### Tricks
Nice Homebrew packages:
* `tig` - Git "GUI" for the console
* `mysql`
* `postgresql`
* `fmdiff` - Adaptor to use Apple's FileMerge as `diff` (`git config --global merge-tool fmdiff`)
* `cmus` - Curses-based music player
* `cclive` - Video downloader
Not from brew:
* `DiffMerge` - nice free merge tool for OSX
```sh
# Show latest casks
cd "/usr/local/Library/Taps/caskroom/homebrew-cask/Casks" && git log --pretty=format: --name-only --since="30 days ago" | egrep "Casks" | uniq
```
Tmux
----

49
xpath.md Normal file
View File

@ -0,0 +1,49 @@
---
title: Xpath
layout: default
--
### Prefixes
// anywhere # //hr[@class='edge']
./ relative # ./a
/ root # /html/body/div
### Conditions (`[]`)
# div[@class="head"]
# div[@class="head" and @id="top"]
contains() # font[contains(@class,"head")]
starts-with() # font[starts-with(@class,"head")]
ends-with() # font[ends-with(@class,"head")]
text() # button[text()="Submit"]
name() # div[child[name()='div']]
lang(str)
namespace-uri()
count() # table[count(tr)=1]
last() # tr[last()]
position() # ol/li[position()=2]
not(expr)
### Axes
/ child # div/a div[child::a]
// descendant # div//a
@ attribute # input[@type="text"]
.. parent # span[parent::[name()='div']]
ancestor
ancestor-or-self
following
following-sibling
preceding
preceding-sibling
### Nesting
a[/span[@class="heading"]]