Skip to content

Instantly share code, notes, and snippets.

View PDXIII's full-sized avatar
😃
Working on my website.

Peter Sekan PDXIII

😃
Working on my website.
View GitHub Profile
@PDXIII
PDXIII / LayoutBreakpoints
Last active April 13, 2023 19:33
media queries layout breakpoints
320px ( 480px) - Smartphone
768px (1024px) - Tablet
1024px ( 768px) - Netbook
1600px ( 900px) - Desktop
@PDXIII
PDXIII / CSS Type Size Calculation
Created April 12, 2013 12:56
Classic calculation of font-sizes for CSS
//Classic calculation of font-sizes found on http://webtypography.net/Harmony_and_Counterpoint/Size/3.1.1/
body { font-size:100%; }
h1 { font-size:2.25em; /* 16x2.25=36 */ }
h2 { font-size:1.5em; /* 16x1.5=24 */ }
h3 { font-size:1.125em; /* 16x1.125=18 */ }
h4 { font-size:0.875em; /* 16x0.875=14 */ }
p { font-size:0.75em; /* 16x0.75=12 */ }
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-Basic_01.pde
Last active December 16, 2015 05:49
Code Snippets for my Unfolding tutorial site
// CHANGE
List<Feature> countries = GeoJSONReader.loadData(this, "countries-simple.geo.json");
// INTO
List<Feature> countries = GeoJSONReader.loadData(this, "countries.geo.json");
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext01_01.pde
Last active December 16, 2015 05:49
Code snippet for my Unfolding tutorial site.
// FIND & DELETE
map.addMarkers(countryMarkers);
// INSERT AT TOP
List<Marker> countryMarkers;
// FIND & CHANGE
List<Marker> countryMarkers = MapUtils.createSimpleMarkers(countries);
// INTO
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext01_02.pde
Created April 15, 2013 11:13
Code snippet for my Unfolding tutorial site.
void draw() {
map.draw();
for (int i = 0; i < countryMarkers.size(); i++){
Marker country = countryMarkers.get(i);
if(country.isInside(map, mouseX, mouseY)){
country.draw(map);
}
}
}
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext01_03.pde
Last active December 16, 2015 05:49
Code snippet for my Unfolding tutorial site.
if(country.isInside(map, mouseX, mouseY)){
country.draw(map);
HashMap countryProps = country.getProperties();
String countryName = countryProps.get("name").toString();
println(countryName);
}
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext01.pde
Created April 15, 2013 11:17
Complete code of the first extended GeoJSONApp for my Unfolding tutorial site.
import de.fhpotsdam.unfolding.mapdisplay.*;
import de.fhpotsdam.unfolding.utils.*;
import de.fhpotsdam.unfolding.marker.*;
import de.fhpotsdam.unfolding.tiles.*;
import de.fhpotsdam.unfolding.interactions.*;
import de.fhpotsdam.unfolding.ui.*;
import de.fhpotsdam.unfolding.*;
import de.fhpotsdam.unfolding.core.*;
import de.fhpotsdam.unfolding.data.*;
import de.fhpotsdam.unfolding.geo.*;
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext02_01.pde
Created April 15, 2013 11:27
Code snippet for my Unfolding tutorial site.
List<Feature> airports = GeoJSONReader.loadData(this, "WorldAirports.geo.json");
List<Marker> airportMarkers = MapUtils.createSimpleMarkers(airports);
map.addMarkers(airportMarkers);
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext02_02.pde
Created April 15, 2013 11:30
Code snippet for my Unfolding tutorial site.
if(!airportListsBuild){
}
else{
}
@PDXIII
PDXIII / UsingUnfolding-GeoJSONApp-ext02_03.pde
Created April 15, 2013 11:31
Code snippet for my Unfolding tutorial site.
if(!airportListsBuild){
airportLists = makeAirportLists(map, countryMarkers, airportMarkers);
}