Skip to content

Instantly share code, notes, and snippets.

View aellispierce's full-sized avatar

Ashley Ellis Pierce aellispierce

View GitHub Profile
@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!
🙏 ❤️ 💰
title
Upgrading Riak

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
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 = {}
@aellispierce
aellispierce / about.md
Last active October 3, 2015 22:53 — forked from jasonrudolph/about.md
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|
@aellispierce
aellispierce / gist:a3867c087e20c1bba30b
Last active August 29, 2015 14:16
Discuss Rails 2

Detailed Rails Questions

  • 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?

    • Render just shows the page without performing any of the actions in the controller. Redirect_to performs the controller actions and then shows the page.
  • 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.

@aellispierce
aellispierce / gist:a5c0a15c237e4fbbe2b7
Last active August 29, 2015 14:16
Discuss Ruby Challenge

Detailed Ruby Questions

  • 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
@aellispierce
aellispierce / gist:4d58549097026147f4ad
Created March 4, 2015 14:09
Inheritance Challenge
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
@aellispierce
aellispierce / gist:ba024d7573bbba5e8f41
Created March 3, 2015 14:20
Composition Challenge
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|