This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set timer to start | |
timer = 60 | |
start_time = Time.now | |
stop_time = start_time + timer | |
holder = 0 | |
def temp | |
system('/opt/vc/bin/vcgencmd measure_temp') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialization file (not found) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prints bizz on multiple of 3, buzz on multiple of 5 and bizzbuzz on a multiple of both 3 and 5 | |
100.times do |i| | |
if i % 3 && i % 5 == 0 | |
puts "FizzBuzz" | |
elsif i % 3 == 0 | |
puts "Fiz" | |
elsif i % 5 == 0 | |
puts "Buzz" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable camera | |
sudo modprobe -r uvcvideo | |
echo "blacklist uvcvideo"|sudo tee /etc/modprobe.d/blacklistcamera.conf | |
# Enable camera | |
# sudo modprobe uvcvideo | |
# sudo rm /etc/modprobe.d/blacklistcamera.conf | |
# Systemwide touchpad tab to click |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
import os | |
good_guesses = [] | |
bad_guesses = [] | |
def start(): | |
clear() | |
print(game) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def game(): | |
# import random | |
import random | |
# generate a random number | |
secrit_num = random.randint(1, 10) | |
# count the attepts to guess | |
attempts = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make a todo list | |
list = [] | |
# print the list | |
def show_items(): | |
print("Your current list has the times:") | |
for item in list: | |
print(item) | |
# add new tiems to the list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
class TimeSheet | |
attr_accessor(:start_time, :finish_time, :launch, :breaks, :meeting) | |
def input | |
week = ['Monday', 'Tuesday','Wednesday', 'Thursday','Friday','Saturday','Sunday' ] | |
week.each do |d| | |
puts "What time did you start? on " + d | |
@start_time = gets | |
puts "What time did you finish working? on " + d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts 'How many units did you achive?' | |
total_units = gets.to_i | |
# validations for the input format | |
if total_units == 0 | |
puts 'Please enter a number that is greater than 0.' | |
end | |
#Counters | |
total_points = 0 | |
submited_counter = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def letter_count(words, letter) | |
if words.include?(letter) | |
count = words.count(letter) | |
puts "The letter #{letter} appears #{count} time(s)" | |
else | |
puts "The letter #{letter} did not appear in '#{words}'" | |
end | |
end | |
# test |
NewerOlder