Skip to content

Instantly share code, notes, and snippets.

@kingcons
kingcons / crash_course.rb
Created August 19, 2015 00:12
August Crash Course
# Pieces of data in Hangman
# - Answer
# - Guesses
# - Turn Count
require 'pry'
words = ["raining", "downpour", "parking", "tuesday",
"bourbon", "sour", "mash", "capitalism",
"puppies", "unicorns", "disestablishmentarianism"
@kingcons
kingcons / july-crash-course.rb
Created July 22, 2015 00:17
Crash Course for July
require 'pry'
words = [
"buffalo", "sportscar", "coffee", "snazzy",
"childish", "futile", "authoritarian", "fantastic",
"beautiful", "building", "macintosh", "airport"
]
answer = words.sample
turn_count = answer.length
@kingcons
kingcons / june.rb
Last active April 24, 2022 16:36
Crash Course 2.0
# require 'pry'
WORDS = ["cookies", "bourbon", "dogs", "sunshine", "vacations",
"dictionaries", "georgia"]
## Pieces of data in Hangman:
# Guesses
# Answer
# Turn Count
@kingcons
kingcons / tic-tac-toe.md
Created June 15, 2015 00:20
Example Assignment

In this assignment, we'll implement a version of tic-tac-toe that we can play from the command line. You should push what you have by Monday at 8am. Incomplete work that is on time and later refined is preferred to late work that is complete and bug-free.

FAQ (based on questions)

  • I would prefer you submit the script as one file and prompt the user for different options (e.g. computer or human 2nd player, hard mode, etc.)

  • Please do not use Classes for this assignment. It is possible we will revisit it

@kingcons
kingcons / issue.md
Created June 3, 2015 18:10
HW 06-03 (SamplServ)

Tonight, you'll write a simple API with Sinatra that can play Daft Punk samples. One of you should write the API, the other person should write a client for the server with HTTParty.

For more info, see the questions.md!

Work with your teammate (see "Teams") on a shared git repository as follows:

  1. One of you should fork the [samplserv][samplserv] project.
@kingcons
kingcons / quiz.md
Created May 20, 2015 12:57
Quiz - 05/20

QUIZ TIME!!!

Section 1 - Classes & Testing

  1. Where are instance variables visible/in scope?

  2. What is the purpose of unit tests?

  3. Can we call methods on a class anywhere we have an instance of that class?

@kingcons
kingcons / quiz.md
Last active November 1, 2016 01:53
Quiz 10/15

Section 1 - Top Level Code, Simple Block Usage

ages = [28, 32, 42, 64]
ages.map { |x| x * 2 }
ages.each { |age| puts "Age is: #{age}" }
  1. What is the result of the ages.map call? What about ages.each?
@kingcons
kingcons / palette-search.lisp
Last active August 29, 2015 14:16
Palette Data Searcher
(ql:quickload 'famiclom)
(in-package :famiclom)
(defparameter *candidates* nil)
(defun init ()
(load-rom "/Users/brit/quicklisp/local-projects/famiclom/roms/smb.nes"))
(defun get-prg ()
@kingcons
kingcons / README.md
Last active August 29, 2015 14:16
Spotify OAuth Notes

Spotify OAuth Integration

If you have questions, I will be happy to expand these notes. Note that you need to add the httparty gem to your Gemfile for this code to work! You may also want to get RSpotify to handle this for you! Instructions for trying that are in their README here. I haven't used it before but am more than happy to help debug issues!

Supporting OAuth requires storing Access Tokens, Refresh Tokens, and Expiration Times on the User model. I have not included migrations for that in this code. You can see I assume column names of access_token,

@kingcons
kingcons / gist:f8a0ed7d67e5e16a72a4
Created January 4, 2015 21:50
Install Party!!!

wifi password: Ir0nY@rd$*

You will want to run which command for the commands:

  • brew
  • git
  • rbenv
  • pry

And check for the following versions with command -v or command --version