I hereby claim:
- I am gilbert on github.
- I am mindeavor (https://keybase.io/mindeavor) on keybase.
- I have a public key whose fingerprint is 7DB8 DF5F 0720 815C 104C 416A F8BA C5DA 9D8C 1B56
To claim this, I am signing this object:
/* Create a new file at ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
/* and copy/paste this into it. */ | |
{ | |
"~f"="moveWordForward:"; | |
"~b"="moveWordBackward:"; | |
"~<"="moveToBeginningOfDocument:"; | |
"~>"="moveToEndOfDocument:"; | |
"~v"="pageUp:"; | |
"~d"="deleteWordForward:"; | |
"~^h"="deleteWordBackward:"; |
I hereby claim:
To claim this, I am signing this object:
var animateHeight = { | |
oncreate: function (vnode) { | |
var height = vnode.dom.clientHeight | |
vnode.dom.style.maxHeight = 0 | |
vnode.dom.offsetHeight // Trick to recalc layout | |
window.requestAnimationFrame( ()=> (vnode.dom.style.maxHeight = height+1+"px") ) | |
}, | |
onbeforeremove: function (vnode, done) { | |
vnode.dom.addEventListener('transitionend', done) | |
vnode.dom.style.maxHeight = 0 |
<!DOCTYPE html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="line-numbers.css"> | |
</head> | |
<body> | |
<pre><code>function add (a, b) { | |
return a + b; | |
}</code></pre> |
var BlogComments = {} | |
BlogComments.controller = function (options) { | |
App.state.fetch('blogComments', `/api/blog-post/${ options.blog_id }/comments`) | |
} | |
BlogComments.view = function (ctrl, options) { | |
var comments = App.state.blogComments | |
return m('.blog-comments-component', [ |
var Comment = {] | |
Comment.create = function (attrs) { | |
return m.request({ method: 'POST', url: '/comments', data: attrs }) | |
} | |
// A view-model is basically a temporary, disposable copy of a model. | |
// It allows the user can either commit or cancel the changes they make. | |
Comment.vm = function (attrs) { | |
attrs = attrs || {} |
// m.prop is a great pattern, but Plain-old JavaScript Objects (POJO) are | |
// much more pleasant to work with. | |
// Here's an example of using POJOs with one- and two-way data binding. | |
// First, the helper methods | |
m.setValue = function (obj, prop) { | |
return m.withAttr('value', function(value) { obj[prop] = value }) | |
} |
var Comment = {} | |
Comment.store = Store('Comment') | |
Comment.fetchForPost = function (postId) { | |
return m.request({ method: 'GET', url: '/api/post/' + postId + '/comments' }) | |
.then(Comment.store.syncAll) | |
} |
// Taken from http://loading.io/ | |
uiload { | |
display: inline-block; | |
position: relative; | |
& > div { | |
position: relative; | |
} | |
} | |
@-webkit-keyframes ajax-loader { |