Skip to content

Instantly share code, notes, and snippets.

View bsredbeard's full-sized avatar

Bill Smith bsredbeard

View GitHub Profile
@bsredbeard
bsredbeard / sortableListDirective.js
Created March 4, 2016 16:34
A non-drag & drop list allowing manual sorting. Currently relies on Font Awesome for up/down icons. JsDoc/NgDoc may be incorrect because nothing makes those tools tolerable.
import angular from 'angular';
let listTemplate = `<ul ng-show="sortable.data.length">
<li class="sortable-entry" ng-repeat="entry in sortable.data">
<button ng-disabled="$first" ng-click="sortable.move($index, -1)"><i class="fa fa-arrow-circle-up"></i></button>
<button ng-disabled="$last" ng-click="sortable.move($index, 1)"><i class="fa fa-arrow-circle-down"></i></button>
<span class="entry-text" sortable-item></span>
<button ng-click="sortable.remove($index)">&times;</button>
</li>
</ul>`;

Keybase proof

I hereby claim:

  • I am bsredbeard on github.
  • I am bsredbeard (https://keybase.io/bsredbeard) on keybase.
  • I have a public key whose fingerprint is E967 9162 B199 3ED7 9F1F 9EF9 05C5 44FA 5C60 5DDF

To claim this, I am signing this object:

function Verifier(name, calls){
if(!Array.isArray(calls)){
throw new Error(`Expected ${name} to have been called, but no calls were found.`);
}
var scopeCalls = calls;
this.withArguments = (...args) => {
scopeCalls = calls.filter((call) => {
return call.length === args.length &&
call.map((arg, idx) => arg === args[idx])
.reduce((x,y) => x && y, true);