Skip to content

Instantly share code, notes, and snippets.

App.Router.map ->
@route "a"
@route "b"
@route "ab"
@route "ba"
App.ARoute = Em.Route.extend
events:
animateToB: ->
@transitionTo('ab')
(function(exports) {
window.DS = SC.Namespace.create();
})({});
(function(exports) {
DS.Adapter = SC.Object.extend({
commit: function(store, commitDetails) {
commitDetails.updated.eachType(function(type, array) {
input "app"
output "public"
<script type="text/x-handlebars" data-template-name="blog-post">
{{view Blog.EditFormView contentBinding="content" classBinding="content.isEditing:editing-form"}}
{{view Blog.PostDisplayView contentBinding="content" classBinding="content.isEditing:editing-display"}}
{{#if showComments}}
<div id="disqus_thread"></div>
{{#view contentBinding="content" tagName="script" type="text/javascript"}}
var disqus_shortname = 'ideafreemonoid';
var disqus_identifier = '{{content.slug}}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
@ebryn
ebryn / output.html
Created June 25, 2011 18:12 — forked from gmoeck/output.html
table_example.handlebars
<table>
<tbody tabindex="-1" id="sc201" class="">
<tr tabindex="-1" id="sc210" class="" style="">
<td tabindex="-1" id="sc214" class="" style=""><span tabindex="-1" id="sc216" class="" style="">something</span></td>
<td tabindex="-1" id="sc220" class="" style=""><span tabindex="-1" id="sc221" class="" style="">new</span></td>
</tr>
<tr tabindex="-1" id="sc225" class="" style="">
<td tabindex="-1" id="sc228" class="" style=""><span tabindex="-1" id="sc229" class="" style="">something</span></td>
<td tabindex="-1" id="sc232" class="" style=""><span tabindex="-1" id="sc233" class="" style="">else</span></td>
</tr>
@ebryn
ebryn / mainpage.js
Created June 23, 2011 02:18 — forked from tritchey/mainpage.js
multicolumn template
ListviewTest.testController = SC.ArrayController.create({
content: [ { 'name': 'Item 1', 'description': 'This is item 1' },
{ 'name': 'Item 2', 'description': 'This is item 2' } ],
});
ListviewTest.mainPage = SC.Page.design({
// The main pane is made visible on screen as soon as your app is loaded.
// Add childViews to this pane for views to display immediately on page
MyApp.ParagraphTemplateView = SC.TemplateView.extend({tagName: 'p'});
MyApp.TemplateCollectionView = SC.TemplateCollectionView.extend({
itemView: 'MyApp.ParagraphTemplateView'
});
@ebryn
ebryn / gist:1007720
Created June 4, 2011 08:24
SC.TextArea
SC.TextArea = SC.View.extend({
tagName: 'textarea',
value: null,
placeholder: null,
renderBuffer: function(tagName) {
var buffer = SC.RenderBuffer(tagName);
if (this.get('placeholder')) {
buffer.attr('placeholder', this.get('placeholder'));
}
Company.all.each do |company|
begin
company.description = company.xml_document.description # could have bad characters which cause SQL error
company.save!
rescue => e
puts "FAIL! #{company.name}"
end
end
ejb-mbp2:Gauge ebryn$ rails s -u
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
You did not specify how you would like Rails to report deprecation notices for your development environment, please set config.active_support.deprecation to :log at config/environments/development.rb
| Breakpoint: Rails::Rack::Debugger#initialize(app) at /Users/ebryn/.rvm/gems/rbx-head/gems/railties-3.0.1/lib/rails/rack/debugger.rb:12 (34)
| 12: ::Debugger.start
debug>