Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['range-slider'],
value: 0,
attributeBindings: ['data-slider'],
'data-slider': 0,
valueDidChange: Em.observer('value', function(){
@poteto
poteto / computed-properties.js
Last active August 29, 2015 14:09
Slack-like loading messages in an Ember app
var computed;
App.computed = {};
computed = Ember.computed;
App.computed.sample = function(dependentKey) {
return (computed("" + dependentKey + ".@each", function() {
var items, length;
items = this.getWithDefault(dependentKey, Em.A([]));
@manmal
manmal / comment.coffee
Created November 14, 2014 07:09
Ember Promised Properties
# /app/controllers/comment.coffee
`import promisedProperty from "../utils/promised_property"`
CommentController = Ember.ObjectController.extend
needs: ["application"]
currentUser: Ember.computed.alias('controllers.application.currentUser')
isCommentController: true
@dehuszar
dehuszar / .htaccess
Created November 13, 2014 19:55
.htaccess for Ember-CLI builds
# place in [app]/public so it gets compiled into the dist folder
Options FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
@sketchytech
sketchytech / gist:d0a8909459aea899e67c
Last active March 30, 2021 13:47
Swift: Draw a clock face (part 1)
// accompanies this blogpost http://sketchytech.blogspot.co.uk/2014/11/swift-how-to-draw-clock-face-using.html
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// service
angular
.module('app')
.service('logger', logger);
function logger () {
this.logError = function (msg) {
/* */
};
}
/* A éviter */
function Customer () {
this.name = {};
this.sendMessage = function () { };
}
/* Recommandé */
function Customer () {
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@ultimatemonty
ultimatemonty / ember-crud-pattern.js
Created September 23, 2014 14:31
Ember CRUD pattern
App.PostsController = Em.ArrayController.extend({
actions: {
create: function () {
// some validation logic here
return this.send('createPost');
},
save: function (model) {
// some validation logic here