Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
actions: {
save(string) {
alert(string);
},
cancel(string) {
alert(string);
@HeroicEric
HeroicEric / application_adapter.js.erb
Created February 10, 2014 15:49
Ember data nested URL
export default DS.ActiveModelAdapter.extend({
namespace: 'api/v<%= Rails.application.config.ember.api_version %>',
buildNestedURL: function(parents, type) {
var _this = this;
var url = Ember.makeArray(parents).map(function(model) {
return _this.buildURL(model.constructor.typeKey, model.get('id'));
});
url.push(this.pathForType(type));
require 'pry'
def sort_from_biggest_to_smallest(sorted_statistics, unsorted_statistics)
unsorted = unsorted_statistics
popped_number = unsorted_statistics.pop
sorted = sorted_statistics
remaining_unsorted_objects = []
if unsorted.empty?
return sorted
<dl class="sub-nav">
<dt>Filter:</dt>
{{#link-to 'challenges' (query-params complete=false) tagName='dd'}}
<a {{bind-attr href="view.href"}}>All</a>
{{/link-to}}
{{#link-to 'challenges' (query-params complete=true) tagName='dd'}}
<a {{bind-attr href="view.href"}}>Complete</a>
{{/link-to}}

comet is a gem used for practicing your Ruby skills. It downloads Ruby exercises that come with a test suite that you can run to check if your implementation is correct. To get started, follow the instructions in this guide.

Setup

This section will guide you through the initial setup for comet.

  • Install the gem:
$ gem install comet
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var fileMover = require('broccoli-file-mover');
var vendorTree = fileMover('vendor', {
files: {
'ember-dev/index.js': 'ember/ember.js',
'ember-prod/index.js': 'ember/ember.prod.js'
}
use std::io::println;
fn main() {
for num in range(1, 101) {
let answer =
if is_fifteen(num) {
~"FizzBuzz"
} else if is_three(num) {
~"Fizz"
} else if is_five(num) {
Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)

Keybase proof

I hereby claim:

  • I am heroiceric on github.
  • I am heroiceric (https://keybase.io/heroiceric) on keybase.
  • I have a public key whose fingerprint is 8898 CEFB 6236 4944 9BFF ABF8 BA9A FFB3 EE64 8DDC

To claim this, I am signing this object: