Cheatsheets

Mixpanel cheatsheet

Identify mixpanel.identify('284') mixpanel.people.set({ $email: 'hi@gmail.com' }) // Set common properties mixpanel.register({ age: 28, gender: 'male' }) Track events mixpanel.track('Login success') mixpanel.track('Search', { query: 'cheese' }) References https://mixpanel.com/help/reference/javascript

Read more...

Analytics libraries cheatsheet

Mixpanel mixpanel.identify('284'); mixpanel.people.set({ $email: 'hi@gmail.com' }); mixpanel.register({ age: 28, gender: 'male' }); /* set common properties */ Google Analytics’s 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' });

Read more...

Google Analytics’s analytics.js cheatsheet

Google Analytics’s analytics.js is deprecated. Page view 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', ...

Read more...

docker-compose cheatsheet

Basic example # docker-compose.yml version: '2' services: web: build: . # build from Dockerfile context: ./Path dockerfile: Dockerfile ports: - "5000:5000" volumes: - .:/code redis: image: redis Commands docker-compose start docker-compose stop docker-compose pause docker-compose unpause docker-compose ps docker-compose up docker-compose down Reference Building web: # build from Dockerfile build: . args: # Add build...

Read more...

Semver cheatsheet

Semver Given a version number MAJOR.MINOR.PATCH: MAJORincompatible API changesMINORadd functionality (backwards-compatible)PATCHbug fixes (backwards-compatible) Simple ranges 1.2.3 =1.2.3 >1.2.3 <1.2.3 >=1.2.3 Note that suffixed versions (1.2.3-rc1) are not matched. Ranges ~1.2.3is >=1.2.3 <1.3.0 ^1.2.3is >=1.2.3 <2.0.0 ^0.2.3is >=0.2.3 <0.3.0(0.x.x is special)^0.0.1is =0.0.1(0.0.x is special)^1.2is >=1.2.0 <2.0.0(like ^1.2.0)~1.2is >=1.2.0 <1.3.0(like ~1.2.0)^1is >=1.0.0 <2.0.0 ~1same 1.xsame 1.*same 1same *any version xsame  Hyphenated ranges 1.2.3 - 2.3.0is >=1.2.3 <=2.3.4 Partial right 1.2.3 - 2.3is >=1.2.3 <2.4.01.2.3 - 2is >=1.2.3 <3.0.0 Partial left 1.2 - 2.3.0is 1.2.0 - 2.3.0 When the right is partial (eg, 2.3), missing pieces are assumed to be x (eg, 2.3.x). When the left is partial (eg, 1.2), missing pieces are assumed to be 0 (eg, 1.2.0). Combining ranges >=0.14 <16And (space-separated)0.14.x || 15.x.xOr...

Read more...