Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
value: '<h1>Demo header</h1>This is some <i>italic</i> text.',
options: {
actions:[
{
name: 'titre',
icon: 'Z',
result: () => {
import Ember from 'ember';
export default Ember.Component.extend({
totalCosts:Ember.computed('pricing',
function(){
var costs = {};
costs["price"]=this.get('pricing').get('buy_price');
costs["subscription"]=this.get('pricing').buy_subscription;
costs["perRoom"]=this.get('pricing').buy_per_room;
return costs;
}),
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thePrice: new Pricing,
totalCosts:Ember.computed('pricing',
function(){
var costs = {};
costs["price"]=5;
costs["subscription"]=2;
import Ember from 'ember';
export default Ember.Component.extend({
dateDisabled: Ember.computed('foo',function(){
console.log(this.get('foo'));
return [
function(date){
//console.log(this.get('foo'));
let day = date.getDate()
if (day & 1){
@bsylvain
bsylvain / ruby_tricks.rb
Created July 12, 2017 09:59 — forked from patriques82/Ruby tricks
A list of Ruby tricks from the book "the ruby programming language"
Equality
The equal? method is defined by Object to test whether two values refer to exactly the same
object. For any two distinct objects, this method always returns false:
a = "Ruby" # One reference to one String object
b = c = "Ruby" # Two references to another String object
a.equal?(b) # false: a and b are different objects
b.equal?(c) # true: b and c refer to the same object
By convention, subclasses never override the equal? method. The == operator is the most common
undefined method `each' for "true":String
{"utf8"=>"✓",
"_method"=>"put",
"authenticity_token"=>"TTCSyAiy98vRZOKQDljKlkHYxRiLKBSnhL0iGUVMUq8=",
"shared_produit"=>{"shared"=>"true"},
"commit"=>"Autoriser partage",
"locale"=>"fr",
"produit_id"=>"37"}