Skip to content

Instantly share code, notes, and snippets.

View emperorliu's full-sized avatar
🦄
Working from home

Jeff Liu emperorliu

🦄
Working from home
View GitHub Profile
# Blackjack
# first, we have a deck of 52 cards (how to organize data?)
# - suits value worth 10
# - aces value worth 11 or 1
# dealer is dealt 2 cards at random
# player is dealt 2 cards at
# player goes: choose hit or stay
# Blackjack
# first, we have a deck of 52 cards (how to organize data?)
# - suits value worth 10
# - aces value worth 11 or 1
# dealer is dealt 2 cards at random
# player is dealt 2 cards at
# player goes: choose hit or stay
@emperorliu
emperorliu / gist:ff06bf465534a8b1f246
Created August 6, 2014 20:01
rock paper scissors solutions
# Rock Paper Scissors (OOP)
# both players pick a hand of either "paper", "rock", "scissors".
# then hands are compared and its either a tie (if hands are the same) or p > r, r > s, s > p.
# classes:
# Player,
# Hand
# first you want to draw the board (we start with a 3x3 board), initalize it, two players (player gets X, computer gets O)
# then a loop of where the player goes, and the computer goes, until there are no empty spaces left.
# for each move, we are checking if there is 3 in a row, because then there would be a winner. if there is no winner, and there are no empty spaces left, then it is a tie.
# classes(nouns with attributes):
# player,
# - name
# - marker
# board,
# - all squares marked?
# Blackjack in OO
# major nouns/verbs in blackjack:
# - deck
# - deal
#-scramble
# - card
# - suit / face value
# - dealer
# - hit/stay
@emperorliu
emperorliu / gist:6d4b53ec315fe9a651d2
Created January 24, 2015 11:26
couldn't find file 'jquery-tablesorter'
Started GET "/auth/spotify/callback?code=AQAcNB8I4H1DtAHw-vmir1TqFttvwElrr63qykNJk21jKJTiyOZE9rQgtNM3vWuCD7wBGq_ZzNz8cMafgHhwMkUsBOi501vv7AwB8616Wk9RwB7o0rvczUArRy3erH8AKUNmphmA-Rn-iY32n-Ze1dzQbWe2CkcjugXv-at6wFHQSqvveRLmb5uK4H5Rkz_lx_vWopyN5cEnE8t7sY9EqP8onN1cTdebvPrk5hHxl1lsYKIm_3JGb8OixnFCHMf1uBHJfelIGTuqEDhc5EQ0AvK6oEdAQjW_pLrQKs1SDH6L2VwXV5H9HWMrpa4jmgh-5-lBgRJdoMAJ79xPp25jz4nvh0_dbCoDSc3VQxDaY7JWO4kkFmT6sbEHDufkhz-tiso&state=80f8ddcd8e1602e81003b1d43f5564d2e71f7f944ef9603d" for 127.0.0.1 at 2015-01-24 03:07:35 -0800
I, [2015-01-24T03:07:35.160908 #88396] INFO -- omniauth: (spotify) Callback phase initiated.
Processing by UsersController#spotify as HTML
Parameters: {"code"=>"AQAcNB8I4H1DtAHw-vmir1TqFttvwElrr63qykNJk21jKJTiyOZE9rQgtNM3vWuCD7wBGq_ZzNz8cMafgHhwMkUsBOi501vv7AwB8616Wk9RwB7o0rvczUArRy3erH8AKUNmphmA-Rn-iY32n-Ze1dzQbWe2CkcjugXv-at6wFHQSqvveRLmb5uK4H5Rkz_lx_vWopyN5cEnE8t7sY9EqP8onN1cTdebvPrk5hHxl1lsYKIm_3JGb8OixnFCHMf1uBHJfelIGTuqEDhc5EQ0AvK6oEdAQjW_pLrQKs1SDH6L2VwXV5H9HWMrpa4jmgh-5-lBgRJdoMAJ
**logged in as jefffreak11**
>> RSpotify::Playlist.find("seanarturo", "1sPEU0bs81JzaRXpyQWNCm")
!! 400 Bad Request: {
"error": {
"status": 400,
"message": "Only valid bearer authentication supported"
}
}
BQCdQ_C50U79OXVeEmkjTNFxKtgc1C4crM-XtERfhBYf4mkXxhpbXm4mmu3flUolpMT8Zrl-1n7WHFZTTGZLezN-zTLl0giIx9LbuA4ljDoYVo7UDbWqQ9plFNwzH_O9MwHWuNyHbWTVA20cpAy1bqkxPoQxfqzvH1hsiFcgR8dkLEWTuqPCDTk6vuuswP4KlPcLHD4LrCqsKt28bgjAPtV8chGcvawLyvupVfuIytKQ
@emperorliu
emperorliu / 2018 albums
Last active June 5, 2018 00:59
2018 album list
Non Hip-Hop:
1. Kali Uchis - Isolation (A+) **DEBUT**
2. DJ Koze - Knock Knock (A)
3. Kacey Musgraves - Golden Hour (A)
4. A.A.L (Nicolas Jaar) - 2012-2017 (A)
5. U.S. Girls - In A Poem Unlimited (B+)
6. J Balvin - Vibras (B+)
7. Parquet Courts - Wide Awake! (B+)
8. Janelle Monae - Dirty Computer (B)