- Copy
index.html
andlocale-en.json
to the same directory - From this directory run the
bash
commands below - Open http://127.0.0.1:8080
bower install angular
bower install angular-translate
bower install angular-translate-loader-static-files
index.html
and locale-en.json
to the same directorybash
commands belowbower install angular
bower install angular-translate
bower install angular-translate-loader-static-files
/** | |
* I have seen this a lot lately. | |
* I assume it's to give priority to the request handler for this module. | |
* Otherwise why not just add a new listener and leave existing alone? | |
*/ | |
module.exports.listen = function (server) { | |
var listeners = server.listeners('request').slice(0); | |
server.removeAllListeners('request'); | |
server.on('request', function (req, res) { | |
if (req.url.indexOf('/foo/bar.js') === 0) { |
// Run this from your browser console on your meetup event page (http://www.meetup.com/AngularJS-Utah/events/183104032/) | |
(function () { | |
// Query document for attendees and select a random one | |
const list = document.querySelector('ul.attendees-list').children, | |
item = list[Math.floor(Math.random() * list.length)], | |
name = item ? item.querySelector('h4.text--bold').innerText : 'N/A'; | |
// Remove item so they can only be selected once | |
item && item.parentNode.removeChild(item); | |
First read these tweets:
and this doc:
function notify(title, options) { | |
// Let's check if the browser supports notifications | |
if (!('Notification' in window)) { | |
return; | |
} | |
function n() { | |
new Notification(title, options); | |
} |
function createXHR() { | |
if (!createXHR.__memoize) { | |
var factory = [ | |
function () {return new XMLHttpRequest()}, | |
function () {return new ActiveXObject("Microsoft.XMLHTTP")}, | |
function () {return new ActiveXObject("Msxml3.XMLHTTP")}, | |
function () {return new ActiveXObject("Msxml2.XMLHTTP")}, | |
]; | |
var xhr; |
/** | |
* The problem with using Promises for a request API is that Promises | |
* make it difficult to abort the request. Typically when using XHR | |
* some factory will wrap the actual XHR, but ultimately will return | |
* the XHR object. | |
* | |
* ``` | |
* var request = performRequest('/user/12345'); | |
* request.abort(); | |
* ``` |
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 | |
} | |
}); |
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); | |
} |
npm test
npm run build
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 ./