Skip to content

Instantly share code, notes, and snippets.

View lrdiv's full-sized avatar

Lawrence Davis lrdiv

View GitHub Profile
@lrdiv
lrdiv / nextlot.scpt
Created December 6, 2015 07:19
Scripting iTerm 2
(* Note: `cdnr` and `cdnem` are custom aliases for this project *)
tell application "iTerm"
(* Creates a new window for our project *)
set newWindow to (create window with default profile)
select first window
tell the current window
(* cd to rails directory and start server *)
activate current session
@lrdiv
lrdiv / ember-page.hbs
Created October 31, 2017 15:33
Ember pagination components with truncated page display
<a class='page-link' {{action 'setPage' page}} href=''>{{page}}</a>
@lrdiv
lrdiv / file.js
Last active November 21, 2017 18:00
// return [{ "name": '', "id": '' }].concat(paymentOptions.map(function(p){ return {"name": p.get('name'), "id": p.get("id")} }));
return paymentOptions.reduce((a, b) => a.push(b.getProperties('id', 'name')), [{"name": "", "id": ""]);
// OR
return paymentOptions.reduce(function(a, b) {
return a.push(b.getProperties('id', 'name'));
}, [{"name": "", "id": ""}])