Skip to content

Instantly share code, notes, and snippets.

John Mertens mertonium

Block or report user

Report or block mertonium

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chromedriver.rb
class Chromedriver < Formula
desc "Tool for automated testing of webapps across many browsers"
homepage ""
url ""
version "2.34"
sha256 "bc4ad903c1f85ed328726a9914fbec9d539be8eda0a5489e8dc5dd08123d28fc"
bottle :unneeded
def install
View run phoenix on amazon
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
# erlang
tar -zxvf otp_src_20.2.tar.gz
mertonium / vanilla_get_json.js
Last active May 15, 2020
When you want a promisified version of jQuery's $.getJSON function
View vanilla_get_json.js
* Usage:
* getJSON("", { postId: 1})
* .then(data => {
* console.log(data);
* });
function getJSON(url, qs_params) {
function buildQueryString(params) {
mertonium / sf_endpoint_creation.rb
Last active Aug 29, 2015
Blocks of ruby code that can add the Citygram-SF endpoints to
View sf_endpoint_creation.rb
Publisher.create! do |pub|
pub.title = "Street Tree List"
pub.endpoint = "" = true
pub.visible = true = "San Francisco"
pub.icon = "leaf-collection.png"
pub.state = "CA"
pub.description = "List of DPW maintained street trees including: Planting date, species, and location"
pub.tags = ["san-francisco","san francisco","sf","trees"]
mertonium / Gemfile
Last active Aug 29, 2015
Nokogiri custom pseudo selector
View Gemfile
source ''
gem "nokogiri", "1.6.1"
gem "rspec", "~>2.14.0"
View command_line_example.rb
:001 > require 'feedjira'
:002 > require './janky_parser.rb'
:003 > feed_url = ''
# Add our custom parser to the top of the stack of feeds Feedjira uses.
:004 > Feedjira::Feed.add_feed_class Feedjira::Parser::Versa::JankyPublisher
# Fetch and parse our example feed
:005 > feed = Feedjira::Feed.fetch_and_parse feed_url
:006 > feed.class
=> Feedjira::Parser::Versa::JankyPublisher # Sweet! Our parser was chosen to parse the feed.
mertonium /
Last active Aug 29, 2015
Write up of how we make sure are parser work across the ridiculous world of RSS.

Custom Feed Parsers in a Rails App with Feedjira

Note: Just before I started writing this, I noticed that the Feedzirra gem had 1) changed it's name to Feedjira (explanation here) and 2) had pushed a bunch of updates. Everthing I talk about below worked on 0.2.4, and appears to work just fine on 1.2.0. Also, looking at the CHANGELOG, none of the updates should mess with what I talk about here.

Web feeds (RSS, Atom, etc. - but I tend to call them all "RSS feed"), while sometimes viewed as unfashionable/antiquated, are ubiquitous among web publishers. When you are building a system that needs to know when new content is published, RSS feeds are a perfect low-bar method for doing programmatically discovering new content.

In the Ruby world, Feedjira (formerly, Feedzirra) is the [most popular tool](https://www.

mertonium / stopwords.txt
Created Nov 12, 2013
Bunch of stopwords
View stopwords.txt
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
mertonium / snippet.html
Last active Dec 22, 2016
The Featured Perspective javascript snippet.
View snippet.html
<script data-electnext id="enxt-script" type="text/javascript">
var _enxt = _enxt || [];
_enxt.push(['set_account', 'YOUR_API_KEY']);
_enxt.push(['set_article', 'YOUR_CMS_SPECIFIC_ARTICLE_ID']);
(function() {
var enxt = document.createElement('script'); enxt.type = 'text/javascript'; enxt.async = true;
enxt.src = '//'; var k = document.getElementById('enxt-script');
mertonium / deploy.rb
Last active Oct 10, 2015
Capistrano task to notify about deployment
View deploy.rb
# I am trying out and I want to add their deployment notification to my
# normal capistrano deployment process. Here is my first working attempt.
# Add this task to your deploy.rb
namespace :rollbar do
task :notify, :roles => [:web] do
set :revision, `git log -n 1 --pretty=format:"%H"`
set :local_user, `whoami`
set :rollbar_token, YOUR_ACCESS_TOKEN
rails_env = fetch(:rails_env, 'production')
You can’t perform that action at this time.