I looked around for a good popover library for Ember. I couldn't find one I liked (and was compatible with Ember 1.13 and Glimmer), so I whipped up a little ditty:
// app/pop-over/component.js
import $ from "jquery";I looked around for a good popover library for Ember. I couldn't find one I liked (and was compatible with Ember 1.13 and Glimmer), so I whipped up a little ditty:
// app/pop-over/component.js
import $ from "jquery";| /** | |
| * Extend {{input}} to support html5 range. | |
| * Example: {{input type="range" value=myProperty max="500"}} | |
| * Uses rangeslider.js plugin for IE9 support and to look pretty | |
| * Fires optional onInit, onSlide, and onSlideEnd events | |
| */ | |
| Ember.TextSupport.reopen({ | |
| attributeBindings: ['min', 'max', 'step'], | |
| initRangeSlider: function() { | |
| if (this.get('type') === 'range') { |
| // app/transforms/array.js | |
| import Ember from 'ember'; | |
| import DS from 'ember-data'; | |
| export default DS.Transform.extend({ | |
| deserialize: function(value) { | |
| if (Ember.isArray(value)) { | |
| return Ember.A(value); | |
| } else { | |
| return Ember.A(); |
This post is also on my blog, since Gist doesn't support @ notifications.
Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:
Ember.Controller instead of Ember.ArrayController or Ember.ObjectControllerEmber.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.| // | |
| // To be used like this: | |
| // | |
| // | |
| // {{debounced-input | |
| // placeholder="1000000" | |
| // value=propertyName | |
| // debounceWait=300 <-- debounce wait value | |
| // fireAtStart=false <-- corresponds to Ember.run.debounce’s 4th param, if false, will run at the end of wait period | |
| // class="form-control" <-- all regular text input attributes work |
Create droplet of your liking (ubuntu 12.10 x32)
ssh to root in terminal with your server ip
ssh [email protected]
Add ssh fingerprint and enter password provided in email
| <!-- copy this to YOUR_THEME.tmTheme--> | |
| <dict> | |
| <key>name</key> | |
| <string>diff: deleted</string> | |
| <key>scope</key> | |
| <string>markup.deleted</string> | |
| <key>settings</key> | |
| <dict> | |
| <key>background</key> | |
| <string>#EAE3CA</string> |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This is a deconstuction of matematikaadit's submission to therubygame challenge 5; 'Roman numerals. What are they good IV?'. The goal of the challenge is to take a string representing a roman numeral as input and return the integer that the numeral represents.
matematikaadit currently has the honour of the shortest (by character count) submission for this challenge. At first glance I didn't understand how it worked so I re-wrote and analyzed it until I did.
matematikaadit's original submission: