From b123a1bada7418e7ce4c0b1eacd89ce24d1b746f Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 5 Sep 2014 16:50:56 +0800 Subject: [PATCH] Update cordova, mixpanel, minimist, etc. --- analytics.md | 44 ++++++++++++++++++++++++++++++++++ badges.md | 66 +++++++++++++++++++++++---------------------------- cordova.md | 26 ++++++++++++++++++++ git-extras.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++ minimist.md | 13 ++++++---- 5 files changed, 169 insertions(+), 41 deletions(-) create mode 100644 analytics.md create mode 100644 cordova.md create mode 100644 git-extras.md diff --git a/analytics.md b/analytics.md new file mode 100644 index 000000000..131eece9e --- /dev/null +++ b/analytics.md @@ -0,0 +1,44 @@ +--- +title: Analytics +layout: default +--- + +### Mixpanel + +Identify: + + mixpanel.identify('284'); + mixpanel.people.set({ $email: 'hi@gmail.com' }); + mixpanel.register({ age: 28, gender: 'male' }); /* set common properties */ + +Events: + + mixpanel.track('Login success'); + mixpanel.track('Search', { query: 'cheese' }); + +References: + + * https://mixpanel.com/help/reference/javascript + +### analytics.js + + ga('create', 'UA-XXXX-Y', 'auto'); + ga('create', 'UA-XXXX-Y', { userId: 'USER_ID' }); + + ga('send', 'pageview'); + ga('send', 'pageview', { 'dimension15': 'My custom dimension' ); + +Events: + + ga('send', 'event', 'button', 'click', {color: 'red'}); + ga('send', 'event', 'button', 'click', 'nav buttons', 4); + /* ^category ^action ^label ^value */ + +Exceptions: + + ga('send', 'exception', { + exDescription: 'DatabaseError', + exFatal: false, + appName: 'myapp', + appVersion: '0.1.2' + }) diff --git a/badges.md b/badges.md index 64290bde7..db06452ee 100644 --- a/badges.md +++ b/badges.md @@ -5,48 +5,30 @@ layout: default Here are some badges for open source projects. -### Badges - - * Everything: http://shields.io/ - - * Version badge (gems, npm): http://badge.fury.io/ - - * Dependencies (ruby): http://gemnasium.com/ - - * CI: http://travis-ci.org/ - - * Code quality (ruby): http://codeclimate.com/ - - * Test coverage: https://coveralls.io/ - ### Badge markdown -[![Status](https://travis-ci.org/rstacruz/ento.svg?branch=master)](https://travis-ci.org/rstacruz/ento) + Travis + [![Status](https://travis-ci.org/rstacruz/REPO.svg?branch=master)](https://travis-ci.org/rstacruz/REPO) -### Versions + Travis (shields.io) + [![Status](http://img.shields.io/travis/rstacruz/REPO/master.svg?style=flat)](https://travis-ci.org/rstacruz/REPO "See test builds") -[![npm version](https://img.shields.io/npm/v/jquery.svg)](https://npmjs.org/package/jquery "View this project on npm") -[![npm version](https://badge.fury.io/js/jquery.svg)](https://npmjs.org/package/jquery "View this project on npm") -[![Gem version](https://img.shields.io/gem/v/rails.svg)](http://rubygems.org/gems/rails "View this project in Rubygems") -[![Latest version](http://img.shields.io/github/tag/rstacruz/nprogress.svg)](https://github.com/rstacruz/nprogress) + NPM (shields.io) + [![npm version](http://img.shields.io/npm/v/REPO.svg?style=flat)](https://npmjs.org/package/REPO "View this project on npm") -### Links + Ruby gem (shields.io) + [![Gem](https://img.shields.io/gem/v/GEMNAME.svg?style=flat)](http://rubygems.org/gems/GEMNAME "View this project in Rubygems") -[![npm](https://img.shields.io/badge/npm-jquery-brightgreen.png)](https://npmjs.org/package/jquery "View this project on npm") -[![Gem](https://img.shields.io/gem/v/gem-rails-brightgreen.png)](http://rubygems.org/gems/rails "View this project in Rubygems") ### Etc -[![Gitter chat](https://badges.gitter.im/USER/REPO.png)](https://gitter.im/USER/REPO "Gitter chat") - + Gitter chat [![Gitter chat](https://badges.gitter.im/USER/REPO.png)](https://gitter.im/USER/REPO "Gitter chat") -[![Chat](http://img.shields.io/badge/gitter-rstacruz / nprogress-blue.svg)]( https://gitter.im/rstacruz/nprogress ) - + Gitter chat (shields.io) [![Chat](http://img.shields.io/badge/gitter-USER / REPO-blue.svg)]( https://gitter.im/USER/REPO ) -[![Development Dependency Status](https://david-dm.org/USER/REPO/dev-status.png?theme=shields.io)](https://david-dm.org/USER/REPO#info=devDependencies) - - [![Development Dependency Status](https://david-dm.org/USER/REPO/dev-status.png?theme=shields.io)](https://david-dm.org/USER/REPO#info=devDependencies) + david-dm + [![Dependencies](http://img.shields.io/david/rstacruz/REPO.svg?style=flat)](https://david-dm.org/rstacruz/REPO) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) @@ -83,20 +65,32 @@ Here are some badges for open source projects. $ bower install --save nprogress $ npm install --save nprogress - [![npm version](https://img.shields.io/npm/v/nprogress.png)](https://npmjs.org/package/nprogress "View this project on npm") [bower]: http://bower.io/search/?q=nprogress [npm]: https://www.npmjs.org/package/nprogress ### Acknowledgements - ## Thanks - - **Jsfuse** © 2014+, Rico Sta. Cruz. Released under the [MIT License].
- Authored and maintained by Rico Sta. Cruz with help from [contributors]. + **PROJECTNAME** © 2014+, Rico Sta. Cruz. Released under the [MIT] License.
+ Authored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]). > [ricostacruz.com](http://ricostacruz.com)  ·  > GitHub [@rstacruz](https://github.com/rstacruz)  ·  > Twitter [@rstacruz](https://twitter.com/rstacruz) - [MIT License]: http://mit-license.org/ + [MIT]: http://mit-license.org/ [contributors]: http://github.com/rstacruz/nprogress/contributors + +### Links + + * Everything: http://shields.io/ + + * Version badge (gems, npm): http://badge.fury.io/ + + * Dependencies (ruby): http://gemnasium.com/ + + * CI: http://travis-ci.org/ + + * Code quality (ruby): http://codeclimate.com/ + + * Test coverage: https://coveralls.io/ + diff --git a/cordova.md b/cordova.md new file mode 100644 index 000000000..98b69796f --- /dev/null +++ b/cordova.md @@ -0,0 +1,26 @@ +--- +title: Cordova +layout: default +--- + + cordova plugin ls + cordova plugin search facebook + cordova plugin add com.phonegap.plugins.facebookconnect + + cordova platform add ios + cordova platform ls + cordova platform update ios + cordova platform check + +### Some plugins + +You'll likely need these: + + * [org.apache.cordova.console](https://github.com/apache/cordova-plugin-console) + * [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser) + * [org.apache.cordova.statusbar](https://github.com/apache/cordova-plugin-statusbar) + * org.apache.cordova.splashscreen + +Also: + + * com.phonegap.plugins.facebookconnect diff --git a/git-extras.md b/git-extras.md new file mode 100644 index 000000000..e5613d0a1 --- /dev/null +++ b/git-extras.md @@ -0,0 +1,61 @@ +--- +title: Git extras +layout: default +--- + +### Git-flow + + $ git feature myfeature + switched to branch 'feature/rofl' + + $ ... + $ git checkout develop + $ git feature finish myfeature + merging 'feature/rofl' into develop + deleted branch 'feature/rofl' + +Also `git-bug` and `git-refactor`. + +### Branches + + $ git delete-merged-branches + # hint: do `git remote prune origin` after + + $ git create-branch development + $ git delete-branch development + + $ git fresh-branch gh-pages + +### Inspecting + + $ git summary # repo age, commits, active days, etc + $ git impact # impact graph + $ git effort # commits per file + +### Github + + $ git fork strongloop/express + +### Tags + + $ git release v1.0.0 # commit, tag, push-tags + $ git delete-tag v1.0.0 + +### Conveniences + + $ git ignore "*.log" + +### Locking + +Assumes that changes will not be committed. + + $ git lock config/database.yml + $ git unlock config/database.yml + +### Etc + + $ git obliterate secret.yml # remove all references to it + +### References + + * https://github.com/visionmedia/git-extras diff --git a/minimist.md b/minimist.md index f7a14f86e..fba23b710 100644 --- a/minimist.md +++ b/minimist.md @@ -19,10 +19,13 @@ args == { ``` ```js -if (args.help) { +if (args.help || args._.length === 0) { var cmd = require('path').basename(process.argv[1]); - console.log(require('fs').readFileSync(__dirname+'/../help.txt','utf-8').replace(/\$0/g, cmd)); - ].join('\n')); + console.log( + require('fs') + .readFileSync(__dirname+'/../help.txt','utf-8') + .replace(/\$0/g, cmd) + .trim()); process.exit(); } @@ -36,11 +39,11 @@ if (args.version) { ``` Usage: - $0 FILES [options] + $0 FILES [options] Options: -h, --help print usage information - -V, --version show version info and exit + -v, --version show version info and exit ``` ### Reference