Skip to content

Instantly share code, notes, and snippets.

View bstolte's full-sized avatar

Brian Stolte bstolte

  • San Francisco, CA
View GitHub Profile
@bstolte
bstolte / deck_of_cards_v2.rb
Last active August 29, 2015 14:28
Lesson 12 [Self Directed] - Building a Deck of Cards
class Card
attr_accessor :rank, :suit
def initialize(rank, suit)
self.rank = rank
self.suit = suit
end
def output_card
@bstolte
bstolte / deck_of_cards_v1.rb
Created August 24, 2015 04:08
Lesson 12 [Self Directed] - Building a Deck of Cards
class Card
attr_accessor :rank, :suit
def initialize(rank, suit)
self.rank = rank
self.suit = suit
end
def output_card
#include <string.h>
char server[] = "bstolte.com";
TCPClient client;
int ledPin = D5; // choose the pin for the LED
int inputPin = D7; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int getrequest();
playlist = ['Black Dog', 'Four Sticks', 'Battle of Evermore', 'When The Levee Breaks', 'Stairway to Heaven', 'Rock-n-Roll', 'Misty Mountain Hop', 'Going to California']
def shuffle playlist
shuffled_list = []
while playlist.length > 0
rand_index = rand(playlist.length)
current_index = 0