Skip to content

Instantly share code, notes, and snippets.

View maletor's full-sized avatar

Ellis Berner maletor

View GitHub Profile
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
paperclip (~> 5.1.0) was resolved to 5.1.0, which depends on
activemodel (>= 4.2.0) was resolved to 5.0.0.1, which depends on
activesupport (= 5.0.0.1)
friendly_id (~> 5.1.0) was resolved to 5.1.0, which depends on
activerecord (>= 4.0.0) was resolved to 4.2.7.1, which depends on
activesupport (= 4.2.7.1)
@maletor
maletor / mutual.sql
Last active September 22, 2016 16:25
Query mutual friends through joining the friendships table twice
SELECT `users`.* FROM `users`
INNER JOIN `friendships` `a` ON `users`.`id` = `a`.`friend_id`
INNER JOIN `friendships` `b` ON `users`.`id` = `b`.`friend_id`
WHERE `a`.`user_id` = 1 AND `b`.`user_id` = 2
@maletor
maletor / README.md
Last active August 31, 2016 02:34
Ember.js learning resources

Ember.js

A general word of advice when learning Ember is be very speicfic with dates on the material and version numbers. The API changed rapidly from 1.0 to 2.0 and many concepts no longer apply (e.g. "Views" and "Controllers"). So again, 2.0+ is a must; turn back immediately if it does not specifiy 2.0. Also, do not expect to grasp Ember quickly just because you understand Rails, or React (though knowledge of components and DDAU is useful) or even JavaScript. It requires study like everything else. If you do not already know ES2015, don't worry, you'll learn as you go.

This is an imcomplete list, but I've ordered each category with the things I find the most valuable first.

Introduction

  1. http://fromrailstoember.com/
  2. http://emberigniter.com/new-to-ember-cli-start-here-2016-tutorial/
<input value={{newEmail}}
oninput={{action (action updateEmail) value="target.value"}} />
// app/services/invite.js
recommendationsFromStore: Ember.computed(function(){
return this.get('store').findAll('pymkRecommendation');
}),
import Ember from 'ember';
export default Ember.Component.extend({
store: Ember.inject.service(),
personsYouMayKnow: [],
willRender: function() {
this.get('store').findAll('persons_you_may_know').then((users) => {
this.set('personsYouMayKnow', users);
});
}
# 50-character subject line
#
# 72-character wrapped longer description. This should answer:
#
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
#
# Include a link to the ticket, if any.
diff --git a/app/components/completed-bugs.js b/app/components/completed-bugs.js
new file mode 100644
index 0000000..3a319a1
--- /dev/null
+++ b/app/components/completed-bugs.js
@@ -0,0 +1,21 @@
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ tagName: 'td',
@maletor
maletor / content-for-group.js
Created May 3, 2016 05:46 — forked from mrozema/content-for-group.js
Ember 2.0 compatible select box
import Ember from "ember";
export default Ember.Helper.helper(function([content, group, contentGroupKey]) {
return content.filterBy(contentGroupKey, group);
});
1) Error:
BugTest#test_after_save:
RuntimeError: self and other are not the same object
/Users/maletor/Desktop/test.rb:39:in `block in <class:Comment>'
/Users/maletor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rails-da1fecce32db/activesupport/lib/active_support/callbacks.rb:396:in `instance_exec'
/Users/maletor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rails-da1fecce32db/activesupport/lib/active_support/callbacks.rb:396:in `block in make_lambda'
/Users/maletor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rails-da1fecce32db/activesupport/lib/active_support/callbacks.rb:207:in `block in halting_and_conditional'
/Users/maletor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rails-da1fecce32db/activesupport/lib/active_support/callbacks.rb:456:in `block in call'
/Users/maletor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rails-da1fecce32db/activesupport/lib/active_support/callbacks.rb:456:in `each'
/Users/maletor/.rbenv/versions/2.3.