First we want to open a bunch of files based on some pattern,
vim $(grep -Rl 'commentCount' *)
Then we want to a find & replace across all buffers,
bufdo %s/commentCount/comment-count/ | update
| { | |
| "reportDescription":{ | |
| "reportSuiteID":"<report-suite-id>", | |
| "date":"2013-05-11", | |
| "dateFrom":"", | |
| "dateTo":"", | |
| "dateGranularity":"hour", | |
| "metrics":[ | |
| { | |
| "id":"event37" |
| require 'socket' | |
| class Graphite | |
| attr_accessor :key | |
| def initialize(opts) | |
| @host = opts[:host] | |
| @port = opts[:port] || 2003 | |
| end |
| GDN-1249 - Badges/sponsorship not showing in Australia - MAY - *** | |
| GDN-1241 - Cinema listings not updating - MAY - ** | |
| GDN-1238 - <title> is too far down the source for Live Blogs - MAY - *** | |
| GDN-1237 - Guardian.co.uk not displaying correctly in IE8 - MAY - * | |
| GDN-1231 - US pressed page is TWO MONTHS out of date - APR - *** | |
| GDN-396 - 500 or "Guru Meditation Error" - APR - *** change | |
| GDN-784 - Going to gu.com/australia sets edition to AU - APR - * change | |
| GDN-822 - guardian.co.uk/rss - top stories rss feed is out of date - APR - *** feedburner change | |
| GDN-930 - Business front and US CIF front content API failing - APR - * | |
| GDN-561 - R2 Responsive football page - Fixtures dropdown at top of page overlaps promo column - MAR - * change |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" | |
| "Mozilla/5.0 (iPod; CPU iPhone OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A551 Safari/8536.25" | |
| "Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) App |
| http://www.nytimes.com/2013/04/21/books/review/the-interestings-by-meg-wolitzer.html?pagewanted=all&_r=0 | |
| http://www.goodreads.com/book/show/195590.Sleepwalking | |
| http://www.theguardian.com/books/2004/apr/10/fiction.alanhollinghurst | |
| http://www.guardian.co.uk/books/gallery/2013/feb/04/the-bell-jar-book-cover-parodies-gallery | |
| http://www.theguardian.com/books/2013/feb/08/sylvia-plath-reflections-on-her-legacy | |
| http://www.hilmawolitzer.com/ | |
| http://www.amazon.com/This-Your-Life-Meg-Wolitzer/dp/0517569299 | |
| http://www.slate.com/blogs/browbeat/2012/06/27/nora_ephron_s_this_is_my_life_her_first_movie_as_a_director_debut_is_a_great_underrated_film_.html | |
| http://www.nytimes.com/2008/05/11/books/review/Green-t.html | |
| http://www.nytimes.com/2012/04/01/books/review/on-the-rules-of-literary-fiction-for-men-and-women.html?pagewanted=all&_r=0 |
| GET /politics/2013/aug/29/welfare-reforms-scottish-independence HTTP/1.1,200 | |
| GET /commentisfree/2013/jul/10/antitrust-apple-plot-publishers-ebook HTTP/1.1,200 | |
| GET /teacher-network/teacher-blog/2013/sep/01/science-teacher-us-education HTTP/1.1,200 | |
| GET /p/3tft2/tw HTTP/1.1,200 | |
| GET /small-business-network/2013/aug/29/social-media-boost-business-tips HTTP/1.1,200 | |
| GET /world/2012/aug/17/iraq-holiday-bombs-kill-93 HTTP/1.1,200 | |
| GET /environment/2013/sep/04/company-fracking-protests-drilling-licences HTTP/1.1,200 | |
| GET /commentisfree/2012/may/21/control-food-resources-supermarket HTTP/1.1,200 | |
| GET /media-network/media-network-blog/video/2013/mar/11/marketing-campaigns-optimisation-personalisation-video HTTP/1.1,200 | |
| GET /media-network/media-network-blog/video/2013/mar/11/marketing-campaigns-optimisation-personalisation-video HTTP/1.1,200 |
| require 'rubygems' | |
| require 'trollop' | |
| require 'json' | |
| require 'cgi' | |
| require 'rest_client' | |
| require 'time' | |
| CONF = Trollop::options do | |
| opt :since, "Seconds elapsed between now and the publication date", :type => :int, :required => true, :short => "-s" |
First we want to open a bunch of files based on some pattern,
vim $(grep -Rl 'commentCount' *)
Then we want to a find & replace across all buffers,
bufdo %s/commentCount/comment-count/ | update
| set search_path to public,vlad; | |
| -- join pageviews to content api via path | |
| with content_ids as | |
| ( | |
| select | |
| id | |
| from | |
| content_dim | |
| where |
| # grep -Ri 'm.d.viewability.Viewability' * | cut -d ':' -f 2- | cut -d ' ' -f 1,2,8- > raw | |
| # ruby formatter < raw > advert-data-raw | |
| # sort advert-data-raw > advert-data-raw.sorted | |
| STDIN.read.split("\n").each { |a| | |
| b = a.split(",") | |
| date = b.shift | |
| data = b.slice(0,b.length).map { |f| | |
| c = f.split("->")[1] | |
| c.gsub!(/Some\(([\d+])\)/, '\1') |