Skip to content

Instantly share code, notes, and snippets.


Niclas Darville ndarville

View GitHub Profile
ndarville /
Last active Mar 15, 2020
How to export and rehost your Tumblr site

How to export and rehost your Tumblr site

(Update: Version 3.2.0 of Jekyll looks like it's breaking a few things, so I've changed the guide to make you specifically install the version I was using, 3.1.3. I believe this is the issue: jekyll/jekyll#5145.)

You will be using jekyll-import to export your Tumblr site, Jekyll to (re)create it, and Surge to rehost it.

Update: You can also use Tumblr's native export feature in your blogs' individual settings. But rehosting that might be tricky. Read my comments below this post for how that works.

Setup and installation

ndarville /
Last active Nov 20, 2018
How to export your Tumblr site

How to export your Tumblr site

You will need to have Ruby installed and the knowledge of how to run commands from the terminal.

  1. Install the [jekyll-import][] gem.

     gem install jekyll-import
  2. Save the included export.rb to an empty folder.

  3. Open export.rb with a text editor and define the website to export under "url".

ndarville /
Created Jul 6, 2016
Danske webforsider på dagen for Chilcotrapporten, 2016-07-06
ndarville /
Last active Mar 29, 2016
News Genius-blocker

Just copy-paste the code to the bottom of your <body> tag in the HTML of the pages you don’t want to be annotated.

On Tumblr, go to, click “Edit HTML”, and put the code at the bottom before the </body> tag. Here is what the bottom of my HTML at looks like, using the default theme:

              (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
ndarville /
Last active Dec 13, 2015
Star Wars: The Force Awakens spoiler filter

Star Wars: The Force Awakens Filter

This is a basic regular expression (pattern-matching script) to detect, and ideally filter, all things Star Wars, be it to avoid spoilers, or just everything Star Wars.

To see the filter in action, go to this [demo][]. To read more about the filter and get the Tweetbot mute filter, go to the [blog post][].

The word list contains a list of some characters and actors. Depending on your degree of blackout, you may consider some of them spoilers. I personally do not, but I can set up a separate page with just the Tweetbot link to protect your innocence.


ndarville / index.html
Last active Oct 29, 2015
Sample Sizes
View index.html
integrity="sha384-gOxMGMgqQH8iYyQE8rmgpaokSRE608gSIXXdC2a/yT+OywUqbNmTCQa3qNO4wvyc" crossorigin="anonymous">
svg {
display: block;
ndarville / d3.min.js
Last active Oct 19, 2015
Sample size and standard error
View d3.min.js
d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function i(){}function u(){}function a(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function o(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=Ca.length;r>e;++e){var i=Ca[e]+t;if(i in n)return i}}function c(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}function l(n){return}function s(){}function f(){}function h(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new i;return t.on=function(t,i){var u,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,u=e.indexOf(a)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function g(){ya.event.preventDefault()}function p(
ndarville / feed.atom
Last active Oct 1, 2015
RSS feed template for sarah
View feed.atom
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="">
<title>{{ }}</title>
<link href="{{ site_url }}/feed.atom" rel="self"/>
<link href="{{ site_url }}/"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ base }}/</id>
// for link in link_collection
View download-bucket.yml
"*.csv": <%= 60 * 30 %>
"*.tsv": <%= 60 * 30 %>
"*.json": <%= 60 * 30 %>
"*": <%= 60 * 5 %>
gzip: true
- .html
- .css
We couldn’t find that file to show.
You can’t perform that action at this time.