npm test
npm run build
- Update package.json & bower.json version
- Update Changelog.md
git commit -am"Releasing x.x.x"
git push
git tag -a vx.x.x -m"version x.x.x"
git push origin --tags
npm publish ./
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
if (typeof GM_xmlhttpRequest === 'function') { | |
import GMAdapter from './GMAdapter'; | |
axios.defaults.adapter = GMAdapter; | |
} | |
export default axios; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
axios.defaults.adapter = (resolve, reject, config) => { | |
let data = null; | |
let status = 200; | |
let headers = {}; | |
// Here you would check some registry of request URLs for response | |
// This would allow you to determine resolve/reject | |
// Also what is the actual data for the response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.screenreader-only { | |
border: 0; | |
clip: rect(0 0 0 0); | |
height: 1px; | |
margin: -1px; | |
overflow: hidden; | |
padding: 0; | |
position: absolute; | |
width: 1px; | |
transform: translatez(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expects an array of scores from 0-10 | |
// Example: nps([10, 9, 10, 4]); -> 50 | |
// See http://www.medallia.com/net-promoter-score/ | |
function nps(scores) { | |
var promoters = 0; | |
var detractors = 0; | |
for (var i=0, l=scores.length; i<l; i++) { | |
if (scores[i] >= 9) promoters++; | |
if (scores[i] <= 6) detractors++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output = document.getElementById('output'); | |
var points; | |
var drawing = false; | |
function handleMouseDown() { | |
points = []; | |
output.innerHTML = ''; | |
document.addEventListener('mousemove', handleMouseMove); | |
document.addEventListener('mouseup', handleMouseUp); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
dir="$1" | |
# No dir provided | |
if [ -z "$dir" ] | |
then | |
dir="`pwd`" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Abort a request using requestId | |
axios.get('/some/url', { | |
requestId: 'some-url' | |
}) | |
.then((res) => { | |
console.log(res.data); | |
}); | |
axios.abort('some-url'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var JSON_START = /^\s*(\[|\{[^\{])/; | |
var JSON_END = /[\}\]]\s*$/; | |
function benchmark(label, fn, data) { | |
console.time(label); | |
for (var i=0; i<1000; i++) { | |
fn(data); | |
} | |
console.timeEnd(label); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = React.createClass({ | |
propDefinition: { | |
requiredStringProp: React.PropTypes.string.isRequired.default('Hello World'), | |
optionalNumberProp: React.PropTypes.number.default(12345), | |
enforcedObjectNoDefaultProp: React.PropTypes.object, | |
defaultValueNoTypeProp: true | |
} | |
}); |