From 4df01578d313bc65a7e9408cc5ba1ed038614b70 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 7 Oct 2014 15:52:58 +0800 Subject: [PATCH] Updates. --- git-log-format.md | 35 +++++++++++++++++++++++++++++++++ homebrew.md | 20 ++++++------------- xpath.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 14 deletions(-) create mode 100644 git-log-format.md create mode 100644 xpath.md diff --git a/git-log-format.md b/git-log-format.md new file mode 100644 index 000000000..518d3beb7 --- /dev/null +++ b/git-log-format.md @@ -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 diff --git a/homebrew.md b/homebrew.md index fa1d0b8e5..ef84e523c 100644 --- a/homebrew.md +++ b/homebrew.md @@ -16,20 +16,12 @@ layout: default brew edit git # Edit this formula brew home git # Open homepage -### Stuff - -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 +### Tricks + +```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 ---- diff --git a/xpath.md b/xpath.md new file mode 100644 index 000000000..d0ad5fb36 --- /dev/null +++ b/xpath.md @@ -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"]] +