teleren/devto huggingface dataset:
Git Log Format String Cheat Sheet
Tags: github, git
Published: 2021-05-13 11:31:40

### Also see

- [Git log cheatsheet](./git-log)
- [Git Log Format String Cheat Sheet](https://cheatsheetmaker.com/git-log-format-string) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### [Author and committer] Committer

#### Name

| Variable | Description |
| --- | --- |
| `%cn` | committer name |
| `%cN` | committer name, respecting mailmap |

#### Email

| Variable | Description |
| --- | --- |
| `%ce` | committer email |
| `%cE` | committer email, respecting mailmap |

#### Date

| Variable | Description |
| --- | --- |
| `%cD` | committer date (rfc2882) |
| `%cr` | committer date (relative) |
| `%ct` | committer date (unix timestamp) |
| `%ci` | committer date (iso8601) |

### [Author and committer] Author

#### Name

| Variable | Description |
| --- | --- |
| `%an` | author |
| `%aN` | author, respecting mailmap |

#### Email

| Variable | Description |
| --- | --- |
| `%ae` | author email |
| `%aE` | author email, respecting mailmap |

#### Date

| Variable | Description |
| --- | --- |
| `%aD` | author date (rfc2882) |
| `%ar` | author date (relative) |
| `%at` | author date (unix timestamp) |
| `%ai` | author date (iso8601) |

### [Log format] Commit

| Variable | Description |
| --- | --- |
| `%s` | commit subject |
| `%f` | commit subject, filename style |
| `%b` | commit body |
| --- | --- |
| `%d` | ref names |
| `%e` | encoding |

### [Log format] Hash

#### Commit

| Variable | Description |
| --- | --- |
| `%H` | commit hash |
| `%h` | (abbrev) commit hash |

#### Tree

| Variable | Description |
| --- | --- |
| `%T` | tree hash |
| `%t` | (abbrev) tree hash |

#### Parent

| Variable | Description |
| --- | --- |
| `%P` | parent hash |
| `%p` | (abbrev) parent hash |

### [Log format] Pretty format

```bash
git log --pretty="format:%H"
```

See the next tables on format variables.
Polyfill.Io Cheat Sheet
Tags: polyfill, cheatsheet
Published: 2021-05-13 11:30:46


### [Optimized] Extra features

```html
<script>if(!(window.fetch&&window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch"></scr'+'ipt>')}</script>
```

This is the same as the previous, but also adds a polyfill for `window.fetch()`. We add a `window.fetch` check and loads the additional `fetch` feature.
### [Optimized] For modern browsers

```html
<script>if(!(window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></scr'+'ipt>')}</script>
```

This only includes polyfill.io when necessary, skipping it for modern browsers for faster load times.

### [Usage] References

* [API example](https://polyfill.io/v2/docs/api) _(polyfill.io)_
* [List of features](https://polyfill.io/v2/docs/features) _(polyfill.io)_

### [Usage] Default usage

```html
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
```

This is the default script for Polyfill.io.

### Reference
* [Polyfill.Io Cheat Sheet](https://cheatsheetmaker.com/polyfillio) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Expect.Js Cheat Sheet
Tags: expectjs, cheatsheet
Published: 2021-05-13 11:30:04


### References

- <https://www.npmjs.com/package/expect>
- <https://github.com/mjackson/expect>
- [Expect.Js Cheat Sheet](https://cheatsheetmaker.com/expectjs) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### Assertions on spies

```js
expect(spy.calls.length).toEqual(1)
expect(spy.calls[0].context).toBe(video)
expect(spy.calls[0].arguments).toEqual([ 'some', 'args' ])
expect(spy.getLastCall().arguments).toEqual(...)
```

```js
expect(spy).toHaveBeenCalled()
expect(spy).toHaveBeenCalledWith('some', 'args')
```

### Spies

```js
const video = {
  play: function () { ··· }
}
```

```js
spy = expect.spyOn(video, 'play')
```

```js
spy = expect.spyOn(···)
  .andCallThrough()      // pass through
  .andCall(fn)
  .andThrow(exception)
  .andReturn(value)
```

### Chaining assertions

```js
expect(3.14)
  .toExist()
  .toBeLessThan(4)
  .toBeGreaterThan(3)
```

Assertions can be chained.

### Assertions

```js
expect(x).toBe(y)
  .toBe(val)
  .toEqual(val)
  .toThrow(err)
  .toExist()          // aka: toBeTruthy()
  .toNotExist()       // aka: toBeFalsy()
  .toBeA(constructor)
  .toBeA('string')
  .toMatch(/expr/)
  .toBeLessThan(n)
  .toBeGreaterThan(n)
  .toBeLessThanOrEqualTo(n)
  .toBeGreaterThanOrEqualTo(n)
  .toInclude(val)     // aka: toContain(val)
  .toExclude(val)
  .toIncludeKey(key)
  .toExcludeKey(key)
```

Also: `toNotBe`, `toNotEqual`, etc for negatives.

### Using

```
npm install --save-dev expect
```
{: .-setup}

```js
// using ES6 modules
import expect, { createSpy, spyOn, isSpy } from 'expect'
```

```js
// using CommonJS modules
var expect = require('expect')
var createSpy = expect.createSpy
var spyOn = expect.spyOn
var isSpy = expect.isSpy
```

Expect is a library for assertions in tests.
See: [mjackson/expect](https://github.com/mjackson/expect)
Python Max Function - All you need to know
Published: 2021-05-13 11:26:52

In this short tutorial, we look at the different ways the Python Max function can be used. We also have a section where we look at the code for each section to help facilitate further understanding.   

This tutorial is a part of our initiative at [Flexiple](https://flexiple.com/), to write short curated tutorials around often used or interesting concepts. 

### Table of Content

- [Where can the function be used?](#where-can-the-function-be-used)
- [Using Max on Iterables](#using-max-on-iterables)
- [Limitations & Caveats](#limitations-and-caveats)

### Where can the function be used?

As the name suggests the Max function in Python is used to return the largest (Maximum) element. Although the value returned is always the largest the methods it uses to arrive at it is based on the arguments passed as a parameter. And depending on the parameter, there are two syntaxes.

The first is quite straightforward, we use this when we are looking to pass a few values and looking to find the maximum among them.

**Syntax 1:**

```python
max(arg1, arg2,)
```

**Parameters:**

`arg1`, `arg2` are values that you are looking to compare, could be a number or a string. 

**Code:**

```python
print(max(1,2,3,4,5))

//Output - 5
```

We shall look at the other syntax, while looking at iterables. 

### Using Max on Iterables

In this section we look at how the Max function works with iterables. When iterables are passed as a parameter, the max function returns the largest value in the iterable. And the syntax is as follows.

**Syntax:**

```python
max(iterable, default)
```

**Parameter:**

`Iterables` - Commonly used ones are - lists, dictionaries, tuples, strings.

`Default` - This value is returned in case the iterable is empty

**Code:**

```python
// Lists
l1 = [5, 10, 15, 20, 25]
print(max(l1));
// Output: 25

//Tuples
t1 = (50, 100, 150)
print(t1);
// Output: 150
```

While using the function on a dictionary, the largest key is returned. 

```python
//Dictionaries
d1 = {5: -5, -10: 10, 20: 15, 22: 4}
print(max(d1))

// Output: 22
```

While using the function on a list of strings the strings are ordered alphabetically and the largest string is returned.

```python
s1 = ["hire", "the", "top", "freelancers"]
print(max(s1))

// Output = "top"
```

### Limitations and Caveats

- In case an empty iterables is passed as a parameter, `ValueError` is returned. However, if a `default` value exists then that is passed.
- Passing values of different data types returns a `TypeError`
Yargs Cheat Sheet
Tags: yargs, cheatsheet
Published: 2021-05-13 11:26:11


### Methods

```
yargs.showHelp()
yargs.help() //=>string
```
### Reject non explicits

```js
  .strict()
```

### Stacking

```js
  .count('verbose')

argv.verbose // -vvv => 3
```

### Examples and more help stuff

```js
  // more help
  .example('...')
  .epilog('copyright 2015')
  .command('start', 'start a server')
```

### Options

```js
  .option('f', {
      alias : 'file',
      describe: 'x marks the spot',
      type: 'string', /* array | boolean | string */
      nargs: 1,
      demand: true,
      demand: 'file is required',
      default: '/etc/passwd'
      // also: count:true, requiresArg:true
  })

  .options({
    f: { ... }
  })
```

### Help and version

```js
var argv = require('yargs')

  // version
  .alias('v', 'version')
  .version(function() { return require('../package').version; })
  .describe('v', 'show version information')

  // help text
  .alias('h', 'help')
  .help('help')
  .usage('Usage: $0 -x [num]')
  .showHelpOnFail(false, "Specify --help for available options")
```

### Basic usage

```js
var argv = require('cs/yargs').argv;

argv._         // [ ... ]
argv.$0        // "node bin/mybin"
argv.verbose   // --verbose
```

### Reference
* [Yargs Cheat Sheet](https://cheatsheetmaker.com/yargs) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
How to build NodeJS/Express Bootstrap views
Tags: node, express, bootstrap
Published: 2021-05-13 11:24:10

https://grokonez.com/node-js/how-to-build-nodejs-express-bootstrap-views

How to build NodeJS/Express Bootstrap views


In the tutorial, we will show how to create a NodeJS/Express application with Bootstrap views.

Related posts:
- <a href="https://grokonez.com/frontend/nodejs-express-bootstrap-image">NodeJS/Express – Bootstrap Image</a>
- <a href="https://grokonez.com/frontend/integrate-nodejs-express-jquery-ajax-post-get-bootstrap-view">Integrate NodeJS/Express – JQuery Ajax POST/GET – Bootstrap view</a>

<!--more-->
<h2>NodeJs/Express Routes</h2>
We will create a NodeJs/Express with Bootstrap views as below structure:

<pre><code class="language-javascript">
/nodejs-express-bootstrap
	/node_modules
	/views
		404.html
		about.html
		index.html
	app.js
	package.json
</code></pre>

We define 3 html bootstrap views 'index.html', 'about.html', and '404.html'.

To handle the routing, we use a built-in function <code>Express Router()</code>, see below code:

<pre><code class="language-javascript">
var express = require("express");
var app = express();
var router = express.Router();

var path = __dirname + '/views/';

router.use(function (req,res,next) {
  console.log("/" + req.method);
  next();
});

router.get("/",function(req,res){
  res.sendFile(path + "index.html");
});

router.get("/about",function(req,res){
  res.sendFile(path + "about.html");
});

app.use("/",router);

app.use("*",function(req,res){
  res.sendFile(path + "404.html");
});
</code></pre>

<code>__dirname</code> variable is global that points to working directory ('nodejs-express-bootstrap' folder).

Next, we analyze below segment code:

More at:

https://grokonez.com/node-js/how-to-build-nodejs-express-bootstrap-views

How to build NodeJS/Express Bootstrap views
Znc Bouncer Cheat Sheet
Tags: znc, cheatsheet
Published: 2021-05-13 11:21:08


### Watch

```
/msg *status loadmod watch
/msg *watch list
/msg *watch add * *watch *rico*
/msg *watch add * *watch *%nick%*
```
### Away

```
/msg *status loadmod away
/msg *away away
/msg *away back
/msg *away show   #=> Show messages
/msg *away delete all
```

### Start

```
/msg *status addserver irc.undernet.org [6667]
/msg *status connect

/msg *status loadmod webadmin
/msg *status loadmod admin
/msg *status loadmod away
/msg *status loadmod awaynick
/msg *status loadmod clientnotify    # Notifies when another client logs
/msg *status loadmod keepnick
/msg *status loadmod kickrejoin
```

### Reference
* [Znc Bouncer Cheat Sheet](https://cheatsheetmaker.com/znc-bouncer) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Deadline Drives Productivity- Role of Time Pressure at Workplace
Tags: productivity
Published: 2021-05-13 11:17:29

Whether it is personal life or professional life, most of our activities are devoted to getting things done on time. Whether it is bringing more customers or taking admission for a son or daughter in a good school, every task has a fixed deadline. Simply put, things are not going to be done without a predetermined deadline. What makes the matter worse is the fact that if deadlines are far away, we keep on delaying the productivity app as much as possible. As a result, we need to complete them at the last moment.

Every productivity app or <b> <a href="https://www.taskopad.com/">task management software</a> </b>is aimed at meeting deadlines. Here we are going to talk about a self-imposed deadline and its impact on your productivity. For example, if you have a project due on Saturday, and you know it will take much time, obviously, you will decline extra commitments. What if this deadline preponed to Friday? Well, you will start working on the project immediately and stay away from distractions.

As per the study based on the categorization of time and its impact on task initiation, near deadlines encourage people to get started on their work immediately and if deadlines are far away, people tend to procrastinate. In other words, time pressure motivates people to finish their tasks more quickly. As per Parkinson’s law, the rate of work or productivity is inversely proportional to the time available. It means that people, or say employees try to maximize performance by taking the full time allotted to them, but this can hinder their productivity. In simple words, more time is spent on any tasks when more time is available.

<b>Original Source:<a href="https://www.taskopad.com/blog/time-pressure-contribute-to-productivity/"> Productivity App</a></b>
Vim Scripting Cheat Sheet
Tags: vim, cheatsheet
Published: 2021-05-13 11:17:29


### [Strings] Include guards

```vim
if exists('g:loaded_myplugin')
  finish
endif

" ...

let g:loaded_myplugin = 1
```
### [Strings] Syntax

```vim
syn match :name ":regex" :flags

syn region Comment  start="/\*"  end="\*/"
syn region String   start=+"+    end=+"+	 skip=+\\"+

syn cluster :name contains=:n1,:n2,:n3...

flags:
  keepend
  oneline
  nextgroup=
  contains=
  contained

hi def link markdownH1 htmlH1
```

### [Strings] Region conceal

```vim
syn region inBold concealends matchgroup=bTag start="<b>" end="</b>"
hi inBold gui=bold
hi bTag guifg=blue
```

### [Strings] Conceal

```vim
set conceallevel=2
syn match newLine "<br>" conceal cchar=}
hi newLine guifg=green
```

### [Strings] Filetype detection

```vim
augroup filetypedetect
  au! BufNewFile,BufRead *.json setf javascript
augroup END

au Filetype markdown setlocal spell
```

### [Strings] Highlights

```vim
hi Comment
  term=bold,underline
  gui=bold
  ctermfg=4
  guifg=#80a0ff
```

### [Strings] Arguments

| `<buffer>` | only in current buffer |
| `<silent>` | no echo |
| `<nowait>` | |

Syntax
------

### [Strings] Explanation

```vim
[nvixso](nore)map
```

```
 │       └ don't recurse
 │
 └ normal, visual, insert,
   eX mode, select, operator-pending
```

### [Strings] Mapping commands

```vim
nmap
vmap
imap
xmap
nnoremap
vnoremap
inoremap
xnoremap
...
```

### [Strings] Built-ins

```vim
has("feature")  " :h feature-list
executable("python")
globpath(&rtp, "syntax/c.vim")

exists("$ENV")
exists(":command")
exists("variable")
exists("+option")
exists("g:...")
```

Mapping
-------

### Reference
* [Vim Scripting Cheat Sheet](https://cheatsheetmaker.com/vim-scripting) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Typescript Cheat Sheet
Tags: typescript, cheatsheet
Published: 2021-05-13 11:16:47


### Type extraction

```ts
interface Building {
  room: {
    door: string,
    walls: string[],
  };
}

type Walls = Building['room']['walls']; // string[]
```
### Modules

```ts
export interface User { ... }
```

### Generics

```ts
class Greeter<T> {
  greeting: T
  constructor(message: T) {
    this.greeting = message
  }
}

let greeter = new Greeter<string>('Hello, world')
```

### Classes

```ts
class Point {
  x: number
  y: number
  static instances = 0
  constructor(x: number, y: number) {
    this.x = x
    this.y = y
  }
}
```

#### Inheritance

```ts
class Point {...}

class Point3D extends Point {...}

interface Colored {...}

class Pixel extends Point implements Colored {...}
```

#### Short fields initialisation

```ts
class Point {
  static instances = 0;
  constructor(
    public x: number,
    public y: number,
  ){}
}
```

#### Fields which do not require initialisation
```ts
class Point {
  public someUselessValue!: number;
  ...
}
```

### Function types

```ts
interface User { ... }

function getUser(callback: (user: User) => any) { callback({...}) }

getUser(function (user: User) { ... })
```

### Type aliases

```ts
type Name = string | string[]
```

### [Interfaces] Dynamic keys

```ts
{
  [key: string]: Object[]
}
```

### [Interfaces] Read only

```ts
interface User {
  readonly name: string
}
```

### [Interfaces] Optional properties

```ts
interface User {
  name: string,
  age?: number
}
```

### [Interfaces] Explicit

```ts
interface LabelOptions {
  label: string
}

function printLabel(options: LabelOptions) { ... }
```

### Reference
* [Typescript Cheat Sheet](https://cheatsheetmaker.com/typescript) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
NodeJS/Express Rest APIs + Bootstrap Table + AngularJS example
Tags: node, express, restapi, bootstrap
Published: 2021-05-13 11:06:07

https://grokonez.com/node-js/nodejs-express-rest-apis-bootstrap-table-angularjs

NodeJS/Express Rest APIs + Bootstrap Table + AngularJS example

In the tutorial, we show how to use Bootstrap Table & AngularJS to display data from NodeJS/Express RestAPIs.

Related posts:
- <a href="https://grokonez.com/node-js/nodejs-restapis-how-to-create-nodejs-express-restapis-post-get-put-delete-requests">NodeJs/Express RestAPIs – POST/GET/PUT/DELETE requests</a>
- <a href="https://grokonez.com/node-js/nodejs-express-post-get-to-mysql-using-sequelize-angularjs-bootstrap-form">NodeJS/Express – POST/GET to MySQL using Sequelize – AngularJS + Bootstrap form</a>

<!--more-->
<h2>Goal</h2>
We create a NodeJS/Express project as below structure:

<pre><code class="language-javascript">
/NodeJS-Express-AngularJS-Bootstrap-Table
	/app
		/controllers
			customer.controller.js
		/routes
			customer.route.js
	/node_modules
	/resources
		/static
			/js
				angularJsApp.js
	/views
		404.html
		index.html
	package.json
	package-lock.json
	server.js
</code></pre>

Run above project then makes a request <code>http://localhost:8081</code>

-> Bootstrap view:

<img src="https://grokonez.com/wp-content/uploads/2018/05/NodeJS-Express-AngularJS-Bootstrap-Table-view.png" alt="NodeJS-Express-AngularJS-Bootstrap-Table-view" width="673" height="330" class="alignnone size-full wp-image-12269" />
<h2>Practice</h2>
<h3>Setting up NodeJS/Express project</h3>
Create a folder ‘NodeJS-Express-AngularJS-Bootstrap-Table’:

More at:

https://grokonez.com/node-js/nodejs-express-rest-apis-bootstrap-table-angularjs

NodeJS/Express Rest APIs + Bootstrap Table + AngularJS example
Essential Micronutrients Cheat Sheet
Tags: essentialmicronutrients, cheatsheet
Published: 2021-05-13 10:54:22


### [Vitamins] Iron

 * Sources: soybeans, nuts/beans/lentils, beef, whole grains
 * Major benefits: oxygen transport, energy metabolism
 * [Essential Micronutrients Cheat Sheet](https://cheatsheetmaker.com/essential-micronutrients) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### [Vitamins] Vitamin A

 * Sources: meat, poultry, fish, fruits, leafy veggies, orange veggies
(squash/carrots)
 * Dosage: 10,000iu for adults
 * Major benefits: vision, immune boost, reproduction
 * Fat-soluble

See: [nih.gov](http://ods.od.nih.gov/factsheets/Vitam-HealthProfessional/)

### [Vitamins] Iodine

 * Sources: dairy (yogurt, milk, eggs)
 * Major benefits: thyroid gland regulation

See: [whfoods.com](http://www.whfoods.com/genpage.php?tname=nutrient&dbid=69)

### [Vitamins] Calcium

 * Sources: dairy
 * Dosage: 1000mg daily for adults
 * Major benefits: bone mass/strength

See: [nih.gov](http://ods.od.nih.gov/factsheets/calcium.asp)

### [Vitamins] Omega 3

- ···

### [Vitamins] Potassium

- ···

### [Vitamins] Vitamin B12

- ···

### [Vitamins] Vitamin B6

- ···

### [Vitamins] Niacin (Vitamin B3)

- ···

### [Vitamins] Riboflavin (Vitamin B2)

- ···
Parsimmon Cheat Sheet
Tags: parsimmon, cheatsheet
Published: 2021-05-13 10:52:56


### Reference

- <https://github.com/jneen/parsimmon/blob/master/API.md>
- [Parsimmon Cheat Sheet](https://cheatsheetmaker.com/parsimmon) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### Formatting

```js
P.seq(P.number, P.oneOf('+-*/'), P.number)
.map(([left, oper, right]) => ({ oper, left, right }))
```

### Combinators

```js
P.seq(a, b, c)             // sequence of these
P.alt(a, b)                // any of these
P.sepBy(a, P.string(','))  // sequence of `a`, separated by ','
P.sepBy1(a, P.string(',')) // same, at least once

a.or(b)                    // like P.alt(a, b)
a.skip(b)                  // parses `b` but discards it

a.many()
a.times(3)
a.times(1, 4)              // 1 <= x <= 4
a.atMost(10)
a.atLeast(10)
```

### Atoms

```js
P.regexp(/[a-z]+/)
P.string('hello')
P.oneOf('abc')             // like P.regexp(/[abc]/)

P.whitespace
P.optWhitespace
P.eof
```
Ansible Cheat Sheet
Tags: ansible, cheatsheet
Published: 2021-05-13 10:52:11


### References

  * [Intro](http://www.ansibleworks.com/docs/intro_configuration.html)
  * [Modules](http://www.ansibleworks.com/docs/modules.html)
  * [Ansible Cheat Sheet](https://cheatsheetmaker.com/ansible) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### [Roles] Env vars

```
    vars:
      local_home: "{{ lookup('env','HOME') }}"
```

### [Roles] Task: Failures

```
    - name: my task
      command: ...
      register: result
      failed_when: "'FAILED' in result.stderr"

      ignore_errors: yes

      changed_when: "result.rc != 2"
```

### Roles
```
    - host: xxx
      roles:
        - db
        - { role:ruby, sudo_user:$user }
        - web

    # Uses:
    # roles/db/tasks/*.yml
    # roles/db/handlers/*.yml
```
### Vars
```
    - host: lol
      vars_files:
        - vars.yml
      vars:
        project_root: /etc/xyz
      tasks:
        - name: Create the SSH directory.
          file: state=directory path=${project_root}/home/.ssh/
          only_if: "$vm == 0"
```
### Handlers
```
    handlers:
      - name: start apache2
        action: service name=apache2 state=started

    tasks:
      - name: install apache
        action: apt pkg=apache2 state=latest
        notify:
          - start apache2
```
### [Tasks] Includes
```
    tasks:
      - include: db.yml
    handlers:
      - include: db.yml user=timmy
```

### Tasks
```
    - hosts: all
      user: root
      sudo: no
      vars:
        aaa: bbb
      tasks:
        - ...
      handlers:
        - ...
```

### [Getting started] Running a playbook
```
    $ ansible-playbook playbook.yml
```

### [Getting started] Hosts
```
    $ sudo mkdir /etc/ansible
    $ sudo vim /etc/ansible/hosts

    [example]
    192.0.2.101
    192.0.2.102
```
Shopping Cart Laravel 8: Part 02
Tags: laravel, php, webdev
Published: 2021-05-13 10:50:36

#Source Code
[Github](https://github.com/Remonhasan/ecommerce-laravel8)

#Component Create
Create your own component for cart,product details and shop.
Then create a store function in shopcomponent.php as like:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/poy9y115twvstr5ltdei.png)

pass the parameters to the product page as like by adding:

`wire:click.prevent="store({{$product->id}},'{{$product->name}}',{{$product->regular_price}})"`
Mixpanel Cheat Sheet
Tags: mixpanel, cheatsheet
Published: 2021-05-13 10:50:22


### References

* <https://mixpanel.com/help/reference/javascript>
### Track events

```js
mixpanel.track('Login success')
mixpanel.track('Search', { query: 'cheese' })
```

### Identify

```js
mixpanel.identify('284')
mixpanel.people.set({ $email: 'hi@gmail.com' })
```

```js
// Set common properties
mixpanel.register({ age: 28, gender: 'male' })
```

### Reference
* [Mixpanel Cheat Sheet](https://cheatsheetmaker.com/mixpanel) - [Cheat Sheet Maker](https://cheatsheetmaker.com)