Skip to content

Instantly share code, notes, and snippets.

View louisebolden's full-sized avatar

Louise louisebolden

View GitHub Profile
# instead of:
def square(x); x * x end
# we can now have:
def square(x) = x * x
# 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
@louisebolden
louisebolden / css-list-columns-with-break-inside.css
Created September 11, 2017 09:44
A List Element with CSS Columns and `column-break-inside: avoid;`, to display the border-bottom on each list item correctly.
ol, ul {
columns: 3;
-webkit-column-break-inside: avoid;
}
li {
border-bottom: 1px solid silver;
margin-bottom: 1rem;
padding-bottom: 1rem;
}
@louisebolden
louisebolden / cities_and_countries.js
Last active April 13, 2022 11:18
Get a JSON array of cities and countries from Teleport.
$.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,
@louisebolden
louisebolden / schema-markup-localbusiness.html
Created February 17, 2015 11:40
Schema Markup (LocalBusiness)
<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>
@louisebolden
louisebolden / schema-markup-service.html
Created February 17, 2015 11:38
Schema Markup (Service)
<div itemprop="orderedItem" itemscope itemtype="http://schema.org/Service">
<span itemprop="description">Flower delivery</span>
</div>
@louisebolden
louisebolden / schema-markup-product.html
Created February 17, 2015 11:36
Schema Markup (Product)
<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
@louisebolden
louisebolden / schema-markup-review.html
Created February 17, 2015 11:31
Schema Markup (Review)
<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
@louisebolden
louisebolden / schema-markup-event.html
Created February 17, 2015 11:24
Schema Markup (Event)
<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>,