Skip to content

Instantly share code, notes, and snippets.

0x9B3194612297b8d63c8Af2729a20CA02f4fDf114
@dmill
dmill / blockers.md
Created August 7, 2017 14:40
Monday August 7 Stand Up

Monday

Olessia

  • Nested resources
  • saving new records to the DB
  • redirecting

Kayanee

  • Paywall
@dmill
dmill / news.css
Created August 2, 2017 16:11
News Frontend
.lecture-desc {
color: blue;
}
.make-red {
color: red;
}
POST THIS!!!!!!!!!!!!!!
1. SQLite vs. MySQL vs. PostgreSQL - differences and tradeoffs
2. Blockchain - What is it?
3. Graph Data Types - where they're used, why they're used
4. I/O in Ruby - Specifically working with Filesystem
5. Web scraping
6. Sinatra Web Framework vs. Rails
7. Recursion Refresher
8. Ruby Gems and Bundler
9. Exceptions - best practices
10. Regex Cheatsheet - most common types of Regex
@dmill
dmill / simplecto_answers.txt
Created July 6, 2017 16:07
SimpleCTO Answers
1. Question.count
2. Lingo.find(16)
3. Lingo.find_by_term("Linux"), Lingo.where(term: "Linux").first, Lingo.find_by(term: "Linux"), Lingo.where("term = ?", "Linux").first
4. Question.where(user_id: 67), User.find(67).questions
5. User.first(500).pluck(:last_name)
6.*question_count = Question.group(:user_id).count
question_count.values.max
question_count.select {|k, v| v == 10}
7. Question.last.destroy
class Tile
attr_reader :value
def initialize(initial_value)
if initial_value == 0
@mutable = true
@value = nil
else
@mutable = false
@value = initial_value
class Foo
def self.add_fizz_method &block
define_method 'fizz', &block
end
end
class Bar < Foo; end
begin
Bar.new.fizz
module Singing
def sing()
p "LALALALALALALALALA!"
end
end
class Animal; end
class Feces
def initialize(food)
class Fixnum
NUMERAL_MAPPING = { 1000 => "M", 900 => "CM", 500 => "D",
400 => "CD", 100 => "C", 90 => "XC",
50 => "L", 40 => "XL", 10 => "X",
9 => "IX", 5 => "V", 4 => "IV", 1 => "I" }
def to_roman
num = self
NUMERAL_MAPPING.reduce("") do |string, (k, v)|
if num / k != 0