A Pen by Gabriel RiCharde on CodePen.
This file contains 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
var bubble = { | |
"date": Date(), | |
"title": document.title, | |
"url": window.location.toString(), | |
"domain": window.location.hostname, | |
"meta": [document.querySelector("meta[property='og:type']"), document.querySelector("meta[property='og:description']")] | |
}; | |
var keyBubbleObj = [bubble.url, bubble]; |
This file contains 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
var bubble = { | |
"date": Date(), | |
"title": document.title, | |
"url": window.location.toString(), | |
"domain": window.location.hostname, | |
"meta": [document.querySelector("meta[property='og:type']"), document.querySelector("meta[property='og:description']")] | |
}; | |
// so we can interact with bubble object in inspector |
This file contains 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
hash = {a: 10, b: 20, c: 30} | |
hash.each {|key| puts key} | |
# for the output of this, i'm getting: | |
# a | |
# 10 | |
# b | |
# 20 | |
# c |
This file contains 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
puts "Please provide a number between 1 and 10:" | |
num = gets.chomp!.to_i | |
if (num < 10) && (num > 1) | |
string = "#{num} * " | |
loop do | |
if num == 1 | |
string.concat("#{num}") | |
break | |
end |
This file contains 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
// Why optionals as a type in Swift? Because Swift dissalows nil values in all other types! | |
// So the question is, under what circumstances does a value need to be nil? | |
//: 1. A method that cannot return a value | |
var y: Int | |
var s1: String | |
var s2: String | |
s1 = "123" | |
s2 = "ABC" |
A Pen by Gabriel RiCharde on CodePen.
A Pen by Gabriel RiCharde on CodePen.