Skip to content

Instantly share code, notes, and snippets.

View bummzack's full-sized avatar

Roman Schmid bummzack

View GitHub Profile
@ef4
ef4 / app_components_my-button.js
Last active April 7, 2017 01:35
Yielding Actions
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'button',
click: function() {
// In Ember 2.0, actions are just regular functions passed as
// parameters to components. You will be able to invoke them
// by just calling them, like this:
var action = this.get('action');
if (action) {
@lastobelus
lastobelus / gist:7943705
Last active December 31, 2015 05:49
An asynchronous, debounced, optionally caching validator for ember-validations (requires my patch in pull request 64)
var UrlExists = Ember.Object.extend({
test: function(url){
var promise = Ember.Deferred.create();
if(Ember.isEmpty(url)){
promise.reject(false);
} else {
$.getJSON("http://query.yahooapis.com/v1/public/yql?"+
"q=select%20*%20from%20html%20where%20url%3D%22"+
encodeURIComponent(url)+"%22&format=json'&callback=?",
function(data){