Skip to content

Instantly share code, notes, and snippets.

@kingcons
kingcons / toy.js
Created November 12, 2014 03:22
JS Cons Trick
(function () {
var exports = {};
exports.makeArray = function (a, b) {
return function(chooser) {
return chooser(a, b);
};
};
exports.first = function (array) {
@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

@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 / 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 / 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 / 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 / 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 / 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 / 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 / crash_course.rb
Created September 16, 2015 00:05
Crash Course for September
# Gets for input, puts for output
# data to track:
# letters guessed, strings
# turn count, number
# answer, string
# actions in hangman:
# inform user of word length
# take turns until the game ends