Skip to content

Instantly share code, notes, and snippets.

View willkg's full-sized avatar

Will Kahn-Greene willkg

View GitHub Profile
@willkg
willkg / README.md
Last active August 29, 2015 14:04
Happy/sad breakdowns for Firefox OS

Breakdown of happy/sad data by locale for Firefox OS.

Fork this gist and tweak your own dashboard. Keep in mind that Input requests are throttled. If you're tweaking things, you might want to switch to the stage server at input.allizom.org and then switch to the prod server when your code is more stable.

If you have an interesting dashboard, let me know!

/will

@willkg
willkg / poopify.py
Created August 5, 2014 17:34
goes through a vendor/lib/ dir and generates requirements.txt for what's there
import argparse
import os
def get_python_packages(packages_dir):
os.chdir(packages_dir)
paths = [path for path in os.listdir('.') if os.path.isdir(path)]
packages = {}
for package_name in paths:
@willkg
willkg / README.rst
Last active August 29, 2015 14:13
table space/rows

README

This is my total crap script(s) to figure out the space used on disk and number of rows for tables in kitsune.

Do:

  1. edit get_schema.sh replacing paths with paths for your system
@willkg
willkg / twitter.com.css
Created March 9, 2015 17:14
nix promoted tweets
.promoted-tweet {
display: none;
}
@willkg
willkg / dump_size.py
Created August 24, 2015 19:13
given a mysql db dump, shows rough tabley bigness
#!/usr/bin/env python
"""
Takes a mysql db dump in the form of:
blah blah blah
INSERT INTO `table_name` VALUES (...)
INSERT INTO `table_name` VALUES (...)
It parses it and returns number of rows and total bytes of data per
@willkg
willkg / search_test.py
Created March 7, 2016 16:25
Run a search and compare against previous search
import json
import os
try:
import requests
from tabulate import tabulate
except ImportError:
print 'Please install "requests" and "tabulate" packages.'
@willkg
willkg / git-bzbranch
Last active December 13, 2021 23:22
git subcommand for looking up bugzilla bugs and generating branch names
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
# This expects Python 3
from distutils.spawn import find_executable
from http.client import HTTPSConnection

Keybase proof

I hereby claim:

  • I am willkg on github.
  • I am willkg (https://keybase.io/willkg) on keybase.
  • I have a public key ASCv61L2W1k6pml_QwoWmDZl8fbJnc_1C9-wMPmpg5SvPAo

To claim this, I am signing this object:

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""To run:
1. ``mkvirtualenv --python=/usr/bin/python3 crashids``
2. ``pip install -r requirements.txt``
3. ``python get_ids_1337688.py <ACCESS_KEY> <SECRET_ACCESS_KEY>``
--
-- Bug 1461321: signatures data migration
--
-- Used for a single data migration October 2018. We can delete it after
-- using it in stage and prod.
BEGIN WORK;
-- Crontabber has a job that updates these tables. We lock the tables here
-- to prevent it from updating the data while we're migrating.