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
// we'll call this "reduce ...spread" | |
let result = items.reduce((acc, item) => ({ | |
...acc, [item.name]: item.value | |
}), {}) |
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
let items = [ | |
{name: "something", value: true}, | |
// ... | |
]; | |
// use reduce to build the new map into an accumulator | |
// we'll refer to this as "reduce mutate" | |
let result = items.reduce((acc, item) => { | |
acc[item.name] = item.value; | |
return acc; |
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
let _ = global._ = require("lodash"); | |
let Benchmark = global.Benchmark = require("benchmark"); | |
let Promise = require("bluebird"); | |
let { Map } = require("immutable"); | |
let { produce } = require("immer"); | |
function getItems(count) { | |
let id = 1; |
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
<template> | |
<div class="google-search"> | |
<button @click="search(text)"> | |
<i class="fa fa-search"></i> | |
</button> | |
<input ref="input" | |
title="Site Search" | |
v-on:keyup.13="search(text)" | |
v-model="text" /> | |
</div> |
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
// Just a little bit of styling... | |
.search-box { | |
margin-right: 0; | |
color: @gray-dark; | |
position: relative; | |
display: inline-block; | |
width: 200px; | |
border-bottom: 2px solid @gray-lighter; | |
min-height: 30px; | |
line-height: normal; |
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
"use strict"; | |
let request = require("request"), | |
cheerio = require("cheerio"), | |
querystring = require("querystring"), | |
sendgrid = require("sendgrid"); | |
let config = require("./config.json"); | |
let mail = sendgrid(config.sendgrid.api_user, config.sendgrid.api_key); |
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
// keyboard and accessibility directive | |
.directive("ngClick", function() { | |
var KEY_ENTER = 13, | |
KEY_SPACE = 32; | |
return { | |
restrict: "A", | |
link: function(scope, elem, attrs) { | |
elem.css({ | |
cursor: "pointer" | |
}); |
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
angular.module("xhr", []) | |
.factory("xhr", function($window, $q) { | |
return function(opts) { | |
var deferred = $q.defer(), | |
XHR_DONE = 4; // can't use XMLHttpRequest.DONE since some awful libraries overwrite window.XMLHttpRequest | |
// defaults | |
opts = angular.extend({ | |
// url: www.google.com, | |
// success: function() {}, |