Skip to content

Instantly share code, notes, and snippets.

View davidlormor's full-sized avatar
⚒️
Building things

David Lormor davidlormor

⚒️
Building things
View GitHub Profile
@davidlormor
davidlormor / example_resource.rb
Last active April 2, 2024 16:21
Avo resource view helpers
# frozen_string_literal: true
class ExampleResource < Avo::BaseResource
include ResourceExtensions
field :id, as: :id
field :name, as: :text
index do
field :some_field, as: :text
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@davidlormor
davidlormor / application.controller.js
Last active February 15, 2016 23:42
Countdown timer
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
countdown: Ember.inject.service(),
actions: {
startTimer: function() {
this.get('countdown').start();
}
@davidlormor
davidlormor / my-component.js
Last active August 29, 2015 14:16
Bind Ember component background-color to attribute
export default Ember.Component.extend({
attributeBindings: ['backgroundColor'],
backgroundColor: 'red', // default background color
setBackgroundColor: function() {
this.$().css('background-color', this.get('background-color'))
}.observes('backgroundColor')
});