Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
HeroicEric / application.route.js
Created July 24, 2015 02:59 — forked from lmcardle/application.route.js
Ember.computed.oneWay issue
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
return {name: 'sam'};
}
});
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
@HeroicEric
HeroicEric / 0_reuse_code.js
Created December 30, 2013 18:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
=begin
salutations = [
'Mr.',
'Mrs.',
'Mr.',
'Dr.',
'Ms.'
]
=end
salutations = [
require 'pry'
games = [
{
home_team: "Patriots",
away_team: "Broncos",
home_score: 7,
away_score: 3
},
{
require 'pry'
games = [
{
home_team: "Patriots",
away_team: "Broncos",
home_score: 7,
away_score: 3
},
{
@HeroicEric
HeroicEric / data.rb
Created November 20, 2013 15:38 — forked from jmoon90/data.rb
team_data = [
{
home_team: "Patriots",
away_team: "Broncos",
home_score: 7,
away_score: 3
},
{
home_team: "Broncos",
away_team: "Colts",
#LIGHT = 5
#MEDIUM = 7.5
#BOLD = 9.75
sub_total = 0
sales_list = []
def is_valid_money?(amount)
!!amount.to_s.match(/\A\d+(\.\d{2})?\z/)
end
require 'pry'
def good_input?(input)
if !(input =~ /^(\d*)\.\d{2}$/)
return false
end
true
end
@HeroicEric
HeroicEric / gist:7539426
Last active December 28, 2015 17:59 — forked from sdanko11/gist:7506171
def error_message
puts "Error invalid amount of money exiting program"
end
def number_check(number)
# Try to make sure everything is indented consistently
number =~ /^\d+(\.\d{0,2})?$/
end
def letter_check(word)