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
# instead of: | |
def square(x); x * x end | |
# we can now have: | |
def square(x) = x * x |
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
# a Person type declared in sig/person.rbs | |
class Person | |
@name: String | |
@contacts: Array[Email] | |
def initialize: (name: String) -> untyped | |
def name: -> String | |
def contacts: -> Array[Email] | |
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
2 * 2 => x | |
puts x # 4 |
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
ol, ul { | |
columns: 3; | |
-webkit-column-break-inside: avoid; | |
} | |
li { | |
border-bottom: 1px solid silver; | |
margin-bottom: 1rem; | |
padding-bottom: 1rem; | |
} |
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
$.get('https://api.teleport.org/api/countries/').then(function(data) { | |
var countries = $.map(data['_links']['country:items'], function(country) { return country.name }); | |
fetchedCities = []; | |
countries.forEach(function(country) { | |
$.get('https://api.teleport.org/api/cities/?search=' + country + '&embed=city%3Asearch-results%2Fcity%3Aitem%2Fcity').then(function(data) { | |
var cities = data['_embedded']['city:search-results']; | |
cities.forEach(function(city) { | |
var city = { | |
country: country, | |
fullName: city['_embedded']['city:item'].full_name, |
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
<div itemscope itemtype="http://schema.org/LocalBusiness"> | |
<h1><span itemprop="name">Flower Delivery Company</span></h1> | |
<span itemprop="description">We deliver beautiful flowers to any address in London.</span> | |
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> | |
<span itemprop="streetAddress">101 High Street</span> | |
<span itemprop="addressRegion">London</span> | |
<span itemprop="postalCode">W1A 2BC</span> |
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
<div itemprop="orderedItem" itemscope itemtype="http://schema.org/Service"> | |
<span itemprop="description">Flower delivery</span> | |
</div> |
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
<div itemscope itemtype="http://schema.org/Product"> | |
<span itemprop="name">Kenmore White 17" Microwave</span> | |
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' /> | |
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | |
<span itemprop="priceCurrency" content="GBP">£</span><span | |
itemprop="price" content="1000.00">800.00</span> | |
<link itemprop="availability" href="http://schema.org/InStock" />In stock |
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
<div itemscope itemtype="http://schema.org/Product"> | |
<span itemprop="name">Kenmore White 17" Microwave</span> | |
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' /> | |
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | |
<span itemprop="priceCurrency" content="GBP">£</span><span | |
itemprop="price" content="1000.00">800.00</span> | |
<link itemprop="availability" href="http://schema.org/InStock" />In stock |
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
<div itemscope itemtype="http://schema.org/Event"> | |
<span itemprop="name">Roman Road Market</span> | |
<span itemprop="startDate" content="2015-02-14T08:00">Saturday February 14th, 8am</span> | |
<div itemprop="location" itemscope itemtype="http://schema.org/Place"> | |
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> | |
<span itemprop="addressLocality">Roman Road</span>, |
NewerOlder