Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven B. Combs' Git stevencombs

View GitHub Profile
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View arduino-led-encoder-servo.ino
/*
Code Objective
Push encoder to turn on LED and servo control
Rotate encoder to move servo
Push encoder to turn off LED and servo control
Code by: Steven B. Combs (steven.combs@gmail.com)
Code date: 2020-03-08
@stevencombs
stevencombs / mega-switched-led-components.svg
Last active Mar 3, 2020
Arduino: Toggle LED with breadboard push button
View mega-switched-led-components.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stevencombs
stevencombs / cloudSettings
Last active Dec 26, 2019
Microsoft Studio Code Sync
View cloudSettings
{"lastUpload":"2019-12-26T23:31:36.251Z","extensionVersion":"v3.4.3"}
@stevencombs
stevencombs / CubeNumberDivisibleBy3.py
Last active Jun 9, 2018
This code is the solution to the Codecademy Python Function Syntax Assignment: Practice Makes Perfect.
View CubeNumberDivisibleBy3.py
# Cube a number if divisible by three with no remainder
# A Codecademy Python assignment
# Dr. Steven B. Combs, coding novice
def cube(n):
"""Cube a number"""
n = n ** 3 # Cube the number
print n # Print the number
return n # Return
@stevencombs
stevencombs / CodecademyPygLatin.py
Last active Feb 17, 2018
Solution to Codecademy (http://www.codecademy.com) Python Pig Latin Assignment.
View CodecademyPygLatin.py
# Convert a normal word to pig latin
# A Codecademy Python assignment (that drove many nuts!)
# Dr. Steven B. Combs, coding novice
pyg = 'ay' # create a variable that contains 'ay'
original = raw_input('Enter a word: ') # request input from the user
if len(original) > 0 and original.isalpha(): # does the variable contain any, and if so, only alpha characters
word = original.lower() # convert variable original to all lower case characters
@stevencombs
stevencombs / Arduino-Blink.ino
Last active Apr 18, 2016
The Hello World Program of the Arduino Platform
View Arduino-Blink.ino
@stevencombs
stevencombs / Redacted.rb
Last active Dec 26, 2015
Request multi word input and request a word to redact from the input. Redacted word will be replaced with "REDACTED" unless word to redact was not found in which case the string will print intact.
View Redacted.rb
# Ruby Getting Started with Programming
# A Codecademy Ruby (Redacted) assignment
# Dr. Steven B. Combs, coding novice
puts "Text to search through: " #Puts text
text = gets.chomp #Request input and "chomp" return
puts "Word to redact: " #Puts text
redact = gets.chomp #Request second input and "chomp" return
words = text.split (" ") #Splits the input into words at each space
@stevencombs
stevencombs / ControlFlows.rb
Created Oct 25, 2013
Various examples of Ruby control flows performing the same task: printing "Hello. " 10 times.
View ControlFlows.rb
# Ruby Getting Started with Programming
# Control flow examples
# Dr. Steven B. Combs, coding novice
# Do
puts "Do"
10.times do
print "Hello. "
end
puts ""
@stevencombs
stevencombs / ThithMeanthWar.rb
Last active Dec 26, 2015
Includes fix to program that provides output for both cases without an error.
View ThithMeanthWar.rb
# Ruby Getting Started with Programming
# A Codecademy Ruby (Thith Meanth War!) assignment
# Dr. Steven B. Combs, coding novice
print "Thtring pleathe: " # Print request for input
user_input = gets.chomp # Capture input and remove default extra line (.chomp)
user_input.downcase! # Change input to all lowercase and replace variable content
if user_input.include? "s" # If the input inlcludes an 's'
user_input.gsub!(/s/, "th") # Perform a global substitution of every 's' with 'th'
print "Your new sting is #{user_input}." # Print string including the new value
You can’t perform that action at this time.