Skip to content

Instantly share code, notes, and snippets.

View trek's full-sized avatar
🏳️‍🌈

Trek Glowacki trek

🏳️‍🌈
View GitHub Profile
@trek
trek / documentation-audit-post-mortem.md
Last active December 21, 2015 17:59
Post mortem on Ember.js 1.0 documentation audit

##Docs Audit Postmortem

In preparation for the Ember.js 1.0 release we performed a documentation audit of the YUIDoc-formatted inline API documentation that becomes the text of http://emberjs.com/api/.

The goal of this audit was three-fold:

  • verify each documented API for correctness
  • add documentation to public APIs that were undocumented
  • update examples that are no longer considered best practices
@trek
trek / ember.html
Last active December 21, 2015 13:29
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{input type="text" value=searchText placeholder="Search..."}}
<ul>
{{#each searchResults}}
<li>{{this}}</li>
{{/each}}
</ul>
</script>
@trek
trek / example.css
Last active December 19, 2015 22:48 — forked from gfranko/example.js
.ember-view .tooltip {
display:none;
}
.ember-view.tip-visible .tooltip {
display:block;
}
@trek
trek / example.js
Last active December 19, 2015 22:39 — forked from gfranko/example.js
App = Ember.Application.create();
App.ExampleController = Ember.Controller.extend({
select: function(){
console.log("an example image was clicked");
}
});
var each = require('my-array-lib').eachMethod,
Array = require('stdlib/array');
Array.prototype.forEach = each; // only way to be sure nobody is up to something tricky.
var each = require('my-array-lib-without-demons/each').eachMethod,
Array = require('stdlib/array');
Array.prototype.forEach = each; // only way to be sure nobody is up to something tricky.
Class.new(Parameters, &@block).new(value).tap do |p|
unless p.valid?
record.errors.add(attribute, :invalid, options.merge(:value => value))
end
end
<div style="display:inline-block; background-color:#fff">
<img src='http://emberjs.com/images/community/outdated.png' style="float:left;">
<p style="margin-left:115px; font-color:#1e1e1e;">
<em>Hey!</em> This article references a pre-release version of Ember.js. Now that Ember.js has reached a 1.0 API the code samples below are no longer correct and the expressed opinions <em>may</em> no longer be accurate.
</p>
</div>
{{view Ember.TextField
valueBinding="storeCard.relevantDate"
classNames="timepicker-default input-small"
}}
<span class='add-on'><i class="icon-time"></i></span>
ChangeStateOnTextEntry = Em.TextField.extend({
insertNewline: function(){
this.get('controller.target').send('someRouterEventName')
}
})