Skip to content

Instantly share code, notes, and snippets.

Avatar

Niclas Darville ndarville

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

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
ndarville / README.md
Last active Nov 20, 2018
How to export your Tumblr site
View README.md

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
ndarville / README.md
Created Jul 6, 2016
Danske webforsider på dagen for Chilcotrapporten, 2016-07-06
@ndarville
ndarville / INSTALLATION.md
Last active Mar 29, 2016
News Genius-blocker
View INSTALLATION.md

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 https://www.tumblr.com/customize/yourblogname, click “Edit HTML”, and put the code at the bottom before the </body> tag. Here is what the bottom of my HTML at https://essays.tumblr.com looks like, using the default theme:

        {block:IfGoogleAnalyticsID}
            <script>
              (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
              (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
              m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
@ndarville
ndarville / README.md
Last active Dec 13, 2015
Star Wars: The Force Awakens spoiler filter
View README.md

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.

License

@ndarville
ndarville / index.html
Last active Oct 29, 2015
Sample Sizes
View index.html
<script
type="text/javascript"
charset="utf-8"
src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
integrity="sha384-gOxMGMgqQH8iYyQE8rmgpaokSRE608gSIXXdC2a/yT+OywUqbNmTCQa3qNO4wvyc" crossorigin="anonymous">
</script>
<style>
svg {
display: block;
@ndarville
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 Array.prototype.slice.call(n)}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
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="http://www.w3.org/2005/Atom">
<title>{{ site.name }}</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
<entry>
View download-bucket.yml
max_age:
"*.csv": <%= 60 * 30 %>
"*.tsv": <%= 60 * 30 %>
"*.json": <%= 60 * 30 %>
"*": <%= 60 * 5 %>
gzip: true
gzip:
- .html
- .css
We couldn’t find that file to show.
You can’t perform that action at this time.