This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query.list <- Init(start.date = "2015-11-03", | |
end.date = "2015-12-14", | |
metrics="ga:users,ga:sessions,ga:goal1ConversionRate,ga:goal2ConversionRate,ga:goal3ConversionRate,ga:bounceRate,ga:goal3Completions", | |
dimensions = "ga:date,ga:browser,ga:browserVersion,ga:eventLabel,ga:eventCategory,ga:source", | |
max.results = 10000, | |
sort = "-ga:users", | |
table.id = table.id) | |
ga.query <- QueryBuilder(query.list) | |
return(GetReportData(ga.query, token, split_daywise = T)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT count(username) AS num_contribs, | |
group_concat(username, ' (', user_total_revisions, ' revisions)' separator ', ') AS contribs, | |
sum(user_total_revisions) AS revisions_by_these_contribs, | |
overall_total_revisions, | |
(sum(user_total_revisions) / overall_total_revisions * 100) AS percentage_revisions_by_these_contribs | |
FROM ( | |
/* get usernames WITH X revisions IN ANY month OF the last 3, AND Y revisions overall IN the last 3 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export version=2.7.11 && wget -q https://docs.python.org/2/archives/python-$version-docs-text.zip && unzip -qu python-$version-docs-text.zip && egrep -Ihor "python -m \w+" python-$version-docs-text | sort | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import requests | |
from bs4 import BeautifulSoup | |
from mako.template import Template | |
urls = [ | |
"http://www.mozilla.com/en-US/firefox/10.0/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/10.0.1/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/11.0/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/12.0/releasenotes/buglist.html", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import requests | |
from bs4 import BeautifulSoup | |
urls = [ | |
"http://www.mozilla.com/en-US/firefox/10.0/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/10.0.1/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/11.0/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/12.0/releasenotes/buglist.html", | |
"http://www.mozilla.com/en-US/firefox/13.0/releasenotes/buglist.html", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year = '2014' | |
for month in range(1, 13): | |
month = '%02d' % month | |
for rel in range(1, 7): | |
print '%s-%s.%s' % (year, str(month), str(rel)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def get_some(offset): | |
r = requests.get('https://mozillians.org/api/v1/countries/', params = { | |
'app_name': 'get_your_own', | |
'app_key': 'get_your_own', | |
'format': 'json', | |
'limit': 500, | |
'offset': offset, | |
'is_vouched': 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# depends on an up-to-date local copy of the mozilla.com svn tree!! | |
#cd ~/mozilla/mozilla.com; svn update; cd ~/mozilla/legacy | |
echo "LOCATION, SVN, # FILES, BUG, NEXT STEPS" | |
for FILE in `find ~/mozilla/mozilla.com/en-US \ | |
-type d -name .svn -prune -o \ | |
-type f -name *.html -print -o \ | |
-type d -print` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
* There is no need to run this per location; you can concatenate all input files or all output files. | |
* Modify line 15 with input filename | |
* Direct stdout to output filename (a .sql file) | |
* Work with DBAs (oncall if necessary) to get this done: https://bugzilla.mozilla.org/show_bug.cgi?id=922340 | |
Example output: | |
UPDATE profile, auth_user SET profile.dialog = '14,7,36' WHERE profile.user_id = auth_user.id AND auth_user.username = 'foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from random import shuffle | |
import requests | |
from PIL import Image | |
from io import BytesIO | |
app_name = 'get_your_own' | |
app_key = 'get_your_own' | |
api_cache = 'pix.out' |