-
Fun fact
-
Script
- A script is a text file containing commands/codes/instructions that you write and pass to the a program to run.
-
Terminal
- Also known as
shell
- Also known as
-
The shell is a program that takes keyboard commands and passes them to the operating system to carry out.
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
def to_roman(num) | |
str = '' | |
# Your code here | |
if num >= 1000 | |
str += 'M' * (num / 1000) | |
num %= 1000 | |
end | |
if num == 900 | |
str += 'CM' |
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
def deaf_aunty | |
conversation_done = false | |
until conversation_done | |
puts 'Say something to aunty' | |
reply = gets.chomp | |
if reply == reply.upcase | |
puts 'NO, WE CAN\'T DO THAT!' | |
elsif reply == 'I love ya, aunty, but I\'ve got to go' |
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
def triangle_up(num, char) | |
1.upto(num) { |i| puts char * i } | |
end | |
def triangle_down(num, char) | |
num.downto(1) { |i| puts char * i } | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://fb.me/react-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
require 'Benchmark' | |
class Sudoku | |
attr_accessor :puzzle | |
def initialize | |
@puzzle = '' | |
@game = Array.new(9) | |
@game.map! { Array.new(9) } | |
9.times do |i| |
#SQL notes
SELECT
withinSELECT
- select each country in Europe and show their population in percentage of population of Germany
SELECT name, CONCAT(ROUND(population/(SELECT population FROM world WHERE NAME = 'Germany')*100), '%') FROM world WHERE continent = 'Europe'
ALL
to run through a database list made withSELECT
NewerOlder