Skip to content

Instantly share code, notes, and snippets.

View TatyCat's full-sized avatar
🖥️
From SDG to QA

Tatyanna Cobb TatyCat

🖥️
From SDG to QA
View GitHub Profile
@TatyCat
TatyCat / gist:17453fe0218675aee492
Last active September 9, 2015 19:53
Intro to Ruby Reminders
Interpolated strings must be enclosed in double quotes. The Ruby interpreter will not search for interpolated values in a string if single quotes are used:
ex. p 'hello #{3}'
Notice the decimal used in the assignment of the rate variable. Decimals in programming are called Floats.
Notice the usage of the _ in the assignment of the principal variable. Ruby allows an _ to be used in numbers for better readability. Although an _ can be placed anywhere in a number, the best practice is to place them where a comma would normally be placed. (e.g. 1_000_000).
IF EXAMPLE STATEMENT
def can_buy_apple_with?(money)
if money > 5
@TatyCat
TatyCat / gist:a4f9bccf7427c0724979eb1cd42286d4
Created February 11, 2019 23:55
Volume of a Cuboid - Kata
var Kata;
Kata = (function() {
function Kata() {}
Kata.getVolumeOfCuboid = function(length, width, height){return length * width * height};
return Kata;
})();
@TatyCat
TatyCat / gist:8566e0f4d4589470b6d4fc2919bdfbe2
Created February 14, 2019 00:49
Freaking Geese - Kata
function gooseFilter (birds) {
var geese = ["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"];
//birds array argument is filtered to check if the birds array includes a string that is in geese
//...if it isn't geese, return the string.
let filteredBirds = birds.filter(newBirds => {
return !geese.includes(newBirds)
})
console.log( filteredBirds)
@TatyCat
TatyCat / gist:c26703758b1d9f065189b23ae8c3547e
Last active February 14, 2019 01:52
One-Beginner-Kata
const check = (array,xValue) => {
return array.includes(xValue)
}
@TatyCat
TatyCat / gist:fa1128dd7866b6e2e25c4697ae878fca
Created February 14, 2019 02:04
Beginner Lost Without a Map - Kata
const maps = (arrayOfInts) => {
return arrayOfInts.map( multiplied => multiplied * 2 )
}
# Select all columns for all employees
company_database> SELECT * FROM employees
+------+--------------+----------+------------+-------------------+-------------
| id | full_name | salary | position | phone_extension | part_time
|------+--------------+----------+------------+-------------------+-------------
| 1 | Jamie Smalls | 38293 | <null> | x334 | False
| 2 | Jake William | 3992 | Driver | x429 | True
| 3 | Casem Casey | 49292 | Accountant | x596 | False
+------+--------------+----------+------------+-------------------+-------------
SELECT 3
@TatyCat
TatyCat / new_world.rb
Created March 13, 2019 22:29
ruby hw - New World
# Gavin Stark Psuedo Code
# 1. We remember that a is 1
# 2. We remember that b is 100
# 3. We remember that z is 0
# 4. We tell the user we are going to
# guess a number between "a" and "b"
# 5. User chooses number
# 6. We remember our guess is (a+b) / 2
# 7. Tell the user that we are guessing the number "guess"
# 8. User chooses yes, no