Skip to content

Instantly share code, notes, and snippets.

View bstolte's full-sized avatar

Brian Stolte bstolte

  • San Francisco, CA
View GitHub Profile
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
#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();
@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
@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
class Image
attr_accessor :image
def initialize(image)
self.image = image
end
def output_image
self.image.each do |row|
@bstolte
bstolte / image_blur_2.rb
Last active September 16, 2015 18:24
Image Blur #2
class Image
attr_accessor :image
def initialize(image)
self.image = image
end
def output_image
self.image.each do |row|
@bstolte
bstolte / image_blur_3.rb
Created September 16, 2015 18:23
Image Blur #3
class Image
attr_accessor :image, :blur
def initialize(image)
self.image = image
end
def output_image
self.image.each do |row|
@bstolte
bstolte / dog.rb
Created September 18, 2015 18:01
Quiz # 3 OOP
class Dog
attr_accessor :breed, :years, :name
def initialize(breed, years, name)
@breed = breed
@years = years
@name = name
end
def dog_years
@bstolte
bstolte / reverser_linked_list_1.rb
Created September 18, 2015 18:38
Reverse Linked List #1
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
def print_values(list_node)
@bstolte
bstolte / reverser_linked_list_1.rb
Last active September 19, 2015 21:17
Reversed Link List #1
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
def print_values(list_node)