Skip to content

Commit c3d2d8a

Browse files
committed
subs
1 parent 495e4c2 commit c3d2d8a

11 files changed

+86
-10
lines changed

_posts/2014-05-27-looping-geojson.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Often times I find myself with spatial data in non-spatial formats. Equally as o
2020

2121
It's effectively a javascript object with a standardized format, including **type**, **geometry**, and any number of **properties** (metadata). Much of the time I'm able to convert the data on the client side into a useable geojson format, which can then be mapped. The loop structure is consistent, but how I obtain the data can vary (ajax, jQuery, php, etc.). The use case for this loop is extremely app-specific, so it may not be the thing you need. I just tend to use it a lot for development purposes.
2222

23-
###Basic Loop
23+
### Basic Loop
2424

2525
{% highlight javascript %}
2626
var geojson = {};
@@ -43,7 +43,7 @@ for (var k in data) {
4343
}
4444
{% endhighlight %}
4545

46-
###Tabletop.js
46+
### Tabletop.js
4747

4848
Typically I see data come in .csv formats, which is great for keeping things under control and organized - but difficult for the browser. Lately I've seen most .csv on Google Spreadsheets - which can work to our benefit.
4949

_posts/2014-11-21-d3-background-hash.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ svg.selectAll(".elem")
5454

5555
And voila! You will see some sweet hashing taking effect. One cool thing with SVG patterns that you can see in the example below is that the pattern will run uniformly between elements. If you hover on Tanzania, you'll notice some adminstrative borders each with their own `#hash` style, yet the pattern is fluid between them.
5656

57-
<iframe src="http://broadstreetmaps.giscollective.org/d3hash-example" width="600" height="400" frameborder="0" style="overflow:hidden;"></iframe>
57+
<!-- <iframe src="http://broadstreetmaps.giscollective.org/d3hash-example" width="600" height="400" frameborder="0" style="overflow:hidden;"></iframe> -->
5858

5959
*note: this takes a while to load since it's through an `iframe`, sorry! You can view the [raw example here](http://broadstreetmaps.giscollective.org/d3hash-example)*
6060

6161
To extend it further, you can define multiple patterns based on your data and essentially set them to create a density style map, the difference being the space between your hash lines.
6262

63-
<iframe src="http://broadstreetmaps.giscollective.org/d3hash-example2" width="600" height="400" frameborder="0" style="overflow:hidden;"></iframe>
63+
<!-- <iframe src="http://broadstreetmaps.giscollective.org/d3hash-example2" width="600" height="400" frameborder="0" style="overflow:hidden;"></iframe> -->
6464

6565
D3 is fun!

_posts/2015-01-24-known.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ I have two choices. I can muscle forward and embrace the raucous pounding of thi
99

1010
My fists are clenched. One last look behind clears my mind. Shoulder down and eyes closed, I sprint forward prepared for an inescapable, flooded future. I burst into the waves and am consumed by the salty, windswept waters.
1111

12-
I come up for breath. Open my eyes. Before me lies everything. Behind, not but a memory of days past and decisions made. The sound of the ocean is only disorienting when you try to count the waves. I swim forth.
12+
I come up for breath. Open my eyes. Before me lies everything. Behind, not but a memory of days past and decisions made. The sound of the ocean is only disorienting when you try to count the waves. I swim forth.
13+
14+
![](/images/posts/known.jpg)

_posts/2024-11-08-read-bike.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ title: "Read and ride 🚲"
55

66
After nearly [9 years at Mapbox](http://localhost:4000/posts/mapbox), I decided to step away from my role as technical lead on the Maps API team to seek out a new challenge. I'm excited to join [Read AI](https://read.ai) as a senior engineer on the backend team!
77

8-
While changing jobs is a sizeable life change on its own, one of the biggest changes is that I'm heading into an office three days a week. I've been remote since joining Mapbox, which has been an absolute privilege. It has has allowed me to be productive with my time on my terms, grant additional time to woodworking and DIY projects, and helped me build a more positive relationship with my career.
8+
While changing jobs is a sizeable life change on its own, one of the biggest changes is heading into an office three days a week. I've been remote since joining Mapbox, which has been an absolute privilege. It has has allowed me to be productive with my time on my terms, grant additional time to woodworking and DIY projects, and helped me build a more positive relationship with my career.
99

10-
To be clear, remote work is not appealing because of the distance from co-workers. Historically I've never felt that far from my teams; we even had a WeWork office and co-working spaces here in Seattle for a few years. However, I began feeling more isolated as the team grew and hiring focused on other regions in North America and offices in Europe. Travel became less frequent and ultimately I was ready for more regular human interaction.
10+
To be clear, remote work is not appealing because of the distance from co-workers. Historically I've never felt that far from my teams; we even had a WeWork office and co-working spaces here in Seattle for a few years. However, I began feeling more isolated as hiring focused on other regions in North America and offices in Europe. Travel became less frequent and ultimately I was ready for more regular human interaction.
1111

1212
So, here I am three weeks into my new role, biking into the office when I can. Please enjoy some shots from my new commute, which I'm sure I'll be complaining about in no time 😉
1313

@@ -25,7 +25,7 @@ Octobus.
2525

2626
![](/images/posts/read_ride_4.jpg)
2727

28-
Dumpsters who get it along the Westlake bike trail.
28+
Dumpsters who get it. Along the Westlake bike trail.
2929

3030
![](/images/posts/read_ride_5.jpg)
3131

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: post
3+
title: "Subdomains with GitHub Pages"
4+
---
5+
6+
Hey, it's possible to use subdomains with GitHub Pages.
7+
8+
This website `mapsam.com` is hosted at [github.com/mapsam/mapsam.github.io](https://github.com/mapsam/mapsam.github.io) but sometimes I want to put another site at `something.mapsam.com` rather than the standard `mapsam.com/something` location. This allows me to work on other sites without thinking about relative or absolute URIs and incorrectly writing a CSS or JS file path. It's great for single page applications and not buying new domains, plus you can avoid getting squatted on popular domains like Tom Macwright mentions in [this post](https://macwright.com/2024/10/16/domain-second-thoughts).
9+
10+
This assumes your domain A records are pointing to GitHub's IP addresses already. I use Namepcheap for my domain registration. You can find a working example at [sub.mapsam.com](https://sub.mapsam.com), the source is at [github.com/mapsam/sub](https://github.com/mapsam/sub).
11+
12+
### Create a CNAME file in your repository
13+
14+
Commit this to your repo with the full subdomain value.
15+
16+
```
17+
sub.mapsam.com
18+
```
19+
20+
### Create a CNAME Record on your domain
21+
22+
![](/images/posts/subdomain-dns.png)
23+
24+
The CNAME record will exist alongside your A records. The host should be your subdomain `sub` and the value should be your github pages endpoint `mapsam.github.io.`. You can dig the domain to verify the DNS has propogated and shows up in the answer section.
25+
26+
```sh
27+
dig sub.mapsam.com
28+
```
29+
30+
```
31+
; <<>> DiG 9.10.6 <<>> sub.mapsam.com
32+
;; global options: +cmd
33+
;; Got answer:
34+
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2831
35+
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
36+
37+
;; OPT PSEUDOSECTION:
38+
; EDNS: version: 0, flags:; udp: 512
39+
;; QUESTION SECTION:
40+
;sub.mapsam.com. IN A
41+
42+
;; ANSWER SECTION:
43+
sub.mapsam.com. 1799 IN CNAME mapsam.github.io.
44+
mapsam.github.io. 3600 IN A 185.199.111.153
45+
mapsam.github.io. 3600 IN A 185.199.108.153
46+
mapsam.github.io. 3600 IN A 185.199.109.153
47+
mapsam.github.io. 3600 IN A 185.199.110.153
48+
49+
;; Query time: 96 msec
50+
;; SERVER: 75.75.75.75#53(75.75.75.75)
51+
;; WHEN: Sun Nov 10 22:40:44 PST 2024
52+
;; MSG SIZE rcvd: 137
53+
```
54+
55+
### Enable pages on your repo, check DNS
56+
57+
Going to `Repo >> Settings >> Pages` and select your preferred deployment settings. In [github.com/mapsam/sub](https://github.com/mapsam/sub) I'm just using the "Deploy from a branch" classic settings, which uses Jekyll directly from the `main` branch.
58+
59+
![](/images/posts/subdomain-github-pages.png)
60+
61+
On the same page verify the DNS has been set to the proper value, and that it has been verified. This took about 10 minutes for the first ever subdomain I set up, and only a minute or so for subsequent domains. Even before GitHub can verify the DNS, the propogation is enabled and will work. Verifying the DNS will then allow you to enable HTTPS and get a TLS certificate issued.
62+
63+
![](/images/posts/subdomain-github-domain.png)
64+
65+
You should be all set after this. 👍

images/posts/known.jpg

719 KB
Loading

images/posts/subdomain-dns.png

8.62 KB
Loading
44.9 KB
Loading
29.3 KB
Loading

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ layout: default
99

1010
Hey, I'm Sam.
1111

12-
I'm a software engineer, geographer, and friendly open source software contributor. I'm currently working at [Read AI](https://read.ai) in Seattle, WA on the backend team.
12+
I'm a software engineer and geographer. I'm currently working at [Read AI](https://read.ai) in Seattle, WA on the backend team.
1313

1414
I previously built tools to make fast and beautiful maps at [Mapbox](https://mapbox.com), improved health care delivery as a Fellow at [Code for America](http://codeforamerica.org), and built websites at [Created Media Alliance](https://creativemediaalliance.com). I'm a former Editor for the [Atlas of Design](http://atlasofdesign.org) and proud member of [CUGOS](http://cugos.org). You can find most of my work on **[Github](http://github.com/mapsam)**.
1515

0 commit comments

Comments
 (0)