<commit_before>shake.js
=======================================

A custom 'shake' event JavaScript plugin for mobile web browsers using device accelerometer.

Installation
---------------------------------------

* Download: [zip](https://github.com/alexgibson/shake.js/zipball/master)
* [NPM](https://www.npmjs.org/): `npm install shake.js`
* [Bower](https://github.com/twitter/bower/): `bower install shake.js`
* Git: `git clone https://github.com/alexgibson/shake.js`

Dependencies
---------------------------------------

Your web browser must support the `devicemotion` event for this plugin to work. Shake.js uses built-in feature detection to determine if it can run in your web browser. It will terminate silently on non-supporting browsers.

http://w3c.github.io/deviceorientation/spec-source-orientation.html

Setup
---------------------------------------

For CommonJS using NPM:

```
var Shake = require('shake.js');
```

For AMD module:

```
define(['./shake'], function(Shake) {
    // ...
});
```

In the browser:

```
<script src="shake.js"></script>
```

Next, create a new Shake instance:

```
var myShakeEvent = new Shake({
    threshold: 15, // optional shake strength threshold
    timeout: 1000 // optional, determines the frequency of event generation
});
```

Start listening to device motion:

```
myShakeEvent.start();
```

Register a `shake` event listener on `window` with your callback, you can get the shake strength in the callback function by accessing e.detail.strength property.

```
window.addEventListener('shake', shakeEventDidOccur, false);

//function to call when shake occurs<commit_msg>add shake strength as custom data on the shake event<commit_after>shake.js
=======================================

A custom 'shake' event JavaScript plugin for mobile web browsers using device accelerometer.

Installation
---------------------------------------

* Download: [zip](https://github.com/alexgibson/shake.js/zipball/master)
* [NPM](https://www.npmjs.org/): `npm install shake.js`
* [Bower](https://github.com/twitter/bower/): `bower install shake.js`
* Git: `git clone https://github.com/alexgibson/shake.js`

Dependencies
---------------------------------------

Your web browser must support the `devicemotion` event for this plugin to work. Shake.js uses built-in feature detection to determine if it can run in your web browser. It will terminate silently on non-supporting browsers.

http://w3c.github.io/deviceorientation/spec-source-orientation.html

Setup
---------------------------------------

For CommonJS using NPM:

```
var Shake = require('shake.js');
```

For AMD module:

```
define(['./shake'], function(Shake) {
    // ...
});
```

In the browser:

```
<script src="shake.js"></script>
```

Next, create a new Shake instance:

```
var myShakeEvent = new Shake({
    threshold: 15, // optional shake strength threshold
    timeout: 1000 // optional, determines the frequency of event generation
});
```

Start listening to device motion:

```
myShakeEvent.start();
```

Register a `shake` event listener on `window` with your callback, you can get the shake strength in the callback function by accessing `e.detail.strength` property.

```
window.addEventListener('shake', shakeEventDidOccur, false);

//function to call when shake occurs
{'fraction_non_alphanumeric': 0.21170761298149834, 'fraction_numerical': 0.004246284501061571, 'mean_word_length': 3.185279187817259, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3327728', 'n_tokens_mistral': 948, 'n_tokens_neox': 883, 'n_words': 304}