Skip to content

Instantly share code, notes, and snippets.

View roobottom's full-sized avatar
🍍
That's not my donkey

Jon Roobottom roobottom

🍍
That's not my donkey
View GitHub Profile
View convert-twitter-archive-to-markdown.js
const tweets = require('./tweet.js')
const moment = require('moment')
const matter = require('gray-matter')
const fs = require('fs')
for (t of tweets) {
//ignore any replies or old-style RT
if(t.tweet.in_reply_to_user_id_str === undefined && !t.tweet.full_text.startsWith('RT @')) {
View convert-twitter-archive-to-markdown.js
const tweets = require('./tweet.js')
const moment = require('moment')
const matter = require('gray-matter')
const fs = require('fs')
for (t of tweets) {
//ignore any replies or old-style RT
if(t.tweet.in_reply_to_user_id_str === undefined && !t.tweet.full_text.startsWith('RT @')) {
@roobottom
roobottom / jekyll-get-date-from-filename.js
Last active February 11, 2016 02:14
This file will read a bunch of Jekyll formatted `.md` posts in a folder, grab the date from the filename and write it into the front-matter. Files are copied to a new folder, rather than overwritten.
View jekyll-get-date-from-filename.js
/*
This file will read a bunch of Jekyll formatted `.md` posts in a folder,
grab the date from the filename and write it into the front-matter.
Files are copied to a new folder, rather than overwritten.
Requirements: `npm install lodash`, and that's it!
*/
var fs = require('fs'),
@roobottom
roobottom / index.html
Created February 9, 2016 17:25
zrJmeL
View index.html
<div class="flex_element header">
<div class="wrapper">
<div class="third_party_class">This is the main header,woot</div>
</div>
</div>
<div class="flex_element body">
<div class="wrapper">
<div class="third_party_class">
<p>Keep Scrolling, this is fun!</p>
@roobottom
roobottom / fuzzy-date.html
Last active September 8, 2015 09:32
A fuzzy date calculator for Jekyll.
View fuzzy-date.html
{% if include.daysDiff >= 365 %}
{% assign yearDiff = include.daysDiff | divided_by: 365 | round %}
{% assign yearRemainder = include.daysDiff | modulo: 365 | divided_by: 30 | round %}
{% if yearRemainder != 0 %}
{% if yearRemainder > 10 %}
Almost {{ yearDiff + 1 }} year{% if yearDiff > 1 %}s{% endif %} {{ include.label }}
{% elsif yearRemainder >= 6 %}
{% if yearDiff == 1 %}
A year and a half {{ include.label }}
{% else %}