sudo pip3 install python-vlc
sudo apt-get install python3-rpi.gpio
Or for python2
// https://jrsinclair.com/articles/2019/how-to-run-async-js-in-parallel-or-sequential/ | |
const job = (name, delay) => | |
new Promise((res) => { | |
setTimeout(() => { | |
console.log(`Job(${name}) resolving after ${delay}`); | |
res(); | |
}, delay); | |
}); |
// https://gist.github.com/mjackson/5311256 | |
// http://xahlee.info/js/js_convert_decimal_hexadecimal.html | |
/** | |
* Converts an RGB color value to HSV. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSV_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and v in the set [0, 1]. | |
* | |
* @param Number r The red color value |
# https://www.youtube.com/watch?v=Ct6BUPvE2sM | |
def ouhh(left, right) | |
if left == "pen" && right == "apple" | |
"apple-pen" | |
elsif left == "pen" && right == "pineapple" | |
return "pineapple-pen" | |
elsif left == "apple-pen" && right == "pineapple-pen" | |
return "pen-pineapple-apple-pen" | |
end |
# Homebrew | |
if ! hash brew 2> /dev/null; then | |
echo "You need brew, installing it now..." | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
# Generic stuff | |
brew install cask wget tree nmap ctags git hub bash-completion | |
brew cask install iterm2 mattr-slate slack docker |
require 'io/console' | |
print "Player 1, pick a number: " | |
number = STDIN.noecho(&:gets) | |
puts | |
puts "Player 2, try to guess the number!" | |
print "Guess: " | |
guess = gets |