title |
---|
Upgrading Riak |
Riak is required to run Spreedly. There are installation scripts for Riak in the bootstrap project. Run it to get the new version compiled and installed.
$ pwd
@github/gitcoin has decided to close this issue as part of our weekly iteration planning. | |
This means we might address it at some point in the future but, in an attempt to balance shipping features with the support of existing functionality, we've chosen to prioritize other stories and bugs for the upcoming iterations. | |
If you think addressing this issue should be a priority, please let us know and tell us why in a comment! | |
🙏 ❤️ 💰 |
require 'rubygems' | |
require 'sinatra' | |
require "uri" | |
require "net/http" | |
require 'json' | |
#must use a server with at least ~60 threads to run ex. `puma config.ru -t 0:60` | |
class Proxy < Sinatra::Base | |
JOBS = {} |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
hash = {cool_peaople: 10, bananas: 30, shoes: 20, red: 14} | |
array = hash.values.sort.reverse | |
#returns: | |
# 30 | |
# 20 | |
# 14 | |
# 10 | |
ordered_tuples = Array.new | |
array.each do |value| |
What is the difference between form_for
and form_tag
?
form_for
is used when you're connecting the form to an instance of a class. For example if you want to save a new instance of the User class you would define @user = User.new
and then use "form_for @user
." In contrast, form_tag
is used when you're not specifically connecting it to any instances of classes.What is the difference between render
and redirect_to
?
What is the difference between development and production?
Development is the environment where you make all of your changes and can do things like make new branches for trying new features. Production is where you push the product when it's ready for others to see or use. Whether it's a final product or an MVP.
What is the difference between a hash and an array?
A hash is an unordered collection of key value pairs. An array is ordered and each value in the array corresponds to an index number, instead of a key.
What is the difference between a string and a symbol?
A symbol is similar to a string except for it can refer to a particular method or data table row.
When would you use composition instead of inheritance?
You would use composition if you wanted to create a new class with its own qualities, instead of inheriting qualities from another class
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write code which will be included in the human class which will give humans | |
# intelligent and bipedal behavior. | |
# WRITE YOUR CODE BELOW THIS COMMENT... | |
module Intelligent | |
NUMBER_OF_BRAINS = 1 | |
def say_name |
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write two classes which inherit from the Vehicle class below. You will also | |
# need to add a method to the Vehicle class during this challenge. | |
class Vehicle | |
def initialize(make, model) | |
@make = make | |
@model = model |
require 'minitest/autorun' | |
require 'minitest/pride' | |
# Write a class which wraps around an array, but only allows odd numbers | |
# to be stored in the array. | |
class OddArray | |
def initialize(array) | |
@array = [] | |
array.each do |num| |