Skip to content

Instantly share code, notes, and snippets.

View sevperez's full-sized avatar

Severin Perez sevperez

View GitHub Profile
@sevperez
sevperez / HTML_Skeleton.html
Created August 10, 2017 18:45
Skeleton of a basic HTML file.
<!DOCTYPE html>
<html lang="en-US">
<head>
<title></title>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>
@sevperez
sevperez / rot13.js
Created September 13, 2017 10:26
ls_course_210_rot13
// Encrypts a provided string using the Rot13 cipher
function rot13(string) {
function rotate(char, limit) {
var rotatedCharCode = char.charCodeAt(0) + 13;
if (rotatedCharCode > limit) {
rotatedCharCode -= 26;
}
class Employee
def greeting
puts "Good morning boss!"
end
end
class Spouse
def greeting
puts "Hi honey!"
end
def top_level_inspect_self
p self
end
top_level_inspect_self # main
p Object.private_methods.include?(:top_level_inspect_self) # true
module MyModule
def self.module_inspect_self
p self
end
end
class MyClass
def instance_inspect_self
p self
end
class MyClass
def instance_inspect_self
p self
end
def self.class_inspect_self
p self
end
def self.announce_and_inspect_self
my_instance = MyClass.new
my_instance.instance_inspect_self # <MyClass:0x00000000a88dd8>
a = 4
b = 2
c = a + b
puts c #=> 6
a.class # => Integer
a.public_methods.include?(:+) # => true
[1, 2, 3].public_methods.include?(:==) # => true
42.public_methods.include?(:==) # => true