This file contains hidden or 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
# frozen_string_literal: true | |
# Robot name | |
# When robots come off the factory floor, they have no name. | |
# | |
# The first time you boot them up, a random name is generated in the format of two uppercase letters followed by three digits, such as RX837 or BC811. | |
# | |
# Every once in a while we need to reset a robot to its factory settings, which means that their name gets wiped. The next time you ask, it will respond with a new random name. | |
# | |
# The names must be random: they should not follow a predictable sequence. |
This file contains hidden or 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
# frozen_string_literal: true | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'selenium/webdriver' | |
Capybara.register_driver :firefox do |app| | |
Capybara::Selenium::Driver.new(app, browser: :firefox) | |
end | |
Capybara.default_driver = :firefox |
This file contains hidden or 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
class CustomerScenario | |
def initialize(scenario) | |
@scenario = scenario | |
end | |
end | |
ParameterType( | |
name: 'customer_scenario', | |
regexp: /passed|failed|banned/, |
This file contains hidden or 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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <executable_name>" | |
exit 1 | |
fi | |
executable="$1" | |
IFS=':' read -ra path_dirs <<< "$PATH" |
This file contains hidden or 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
#!/bin/bash | |
# Warning | |
# This assumes you already have copied your schematics to /share/schematics | |
# Also, we delete the original schematics folder in each instance, so back up everything you want to keep | |
multimc_instances_dir="$HOME/.local/share/multimc/instances" | |
shared_schematics_dir="$HOME/.local/share/schematics" | |
# Iterate over each instance folder |
This file contains hidden or 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
#!/bin/bash | |
# Search for directories with name 'functional-tests' in current directory | |
for directory in $(find . -type d -name 'functional-tests'); do | |
# Check if a Gemfile exists in the directory | |
if [ -e "$directory/Gemfile" ]; then | |
# Output which directory is being checked | |
echo -e "\033[0;34mChecking gems in directory:\033[0m $directory" | |
# Change into the directory and run the bundler outdated command |
This file contains hidden or 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
# frozen_string_literal: true | |
module Tictactoe | |
# Player records the symbol being used | |
class Player | |
attr_reader :symbol | |
def initialize(symbol) | |
@symbol = symbol | |
end |
This file contains hidden or 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
=begin | |
Collatz Conjecture | |
Hint: recursion! | |
The Collatz Conjecture or 3x+1 problem can be summarized as follows: | |
Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely. The conjecture states that no matter which number you start with, you will always reach 1 eventually. | |
Given a number n, return the number of steps required to reach 1. | |
Example: | |
Starting with n = 12, the steps would be as follows: | |
12 | |
6 |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<style> | |
.rangeslider{ | |
width: 50%; | |
} | |
.myslider { | |
-webkit-appearance: none; |
NewerOlder