Skip to content

Instantly share code, notes, and snippets.

View paulmolluzzo's full-sized avatar

Paul Molluzzo paulmolluzzo

View GitHub Profile
@paulmolluzzo
paulmolluzzo / translate.rb
Created July 8, 2014 01:36
Easy Translate
#!/usr/bin/ruby
require 'easy_translate'
EasyTranslate.api_key = '' #Get from google
target_path = '' # path to translate
Dir.glob(target_path) do |item|
next if item == '.' or item == '..' or item == '.svn'
I20140626-21:11:11.391(-4)? { statusCode: 200,
I20140626-21:11:11.412(-4)? content: '{"name": "Yo All", "description": "", "renders": ["application/json", "text/html"], "parses": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]}',
I20140626-21:11:11.414(-4)? headers:
I20140626-21:11:11.415(-4)? { connection: 'keep-alive',
I20140626-21:11:11.415(-4)? 'x-frame-options': 'SAMEORIGIN',
I20140626-21:11:11.416(-4)? 'content-type': 'application/json',
I20140626-21:11:11.416(-4)? vary: 'Accept, Cookie',
I20140626-21:11:11.433(-4)? allow: 'POST, OPTIONS',
I20140626-21:11:11.437(-4)? 'transfer-encoding': 'chunked',
I20140626-21:11:11.437(-4)? date: 'Fri, 27 Jun 2014 01:11:10 GMT',
@paulmolluzzo
paulmolluzzo / gist:9948278
Created April 3, 2014 04:28
Improving We Work Meteor RSS Feed

The current implementation of the RSS feed for We Work Meteor (blob used below is here) has an issue when actually used with an RSS reader. Every time a new document is added to a collection, the entire feed is re-published with the whole collection. The reader winds up showing duplicate posts from the last publishing effort.

The solutions I've considered are:

  1. Using amplify to store a the pubDate on the client and then using that to define the earliest post to publish in the feed. Not sure if it's even possible with feed readers.
  2. Add a new property to the collections called published and set it to true once that particular document is published in a feed. Every time the feed is published it would only find published:false documents. An example is below, but the schemas need to be updated too.
  3. Limiting the .find() to just the posts after the last build