Skip to content

Instantly share code, notes, and snippets.

View gregglind's full-sized avatar

Gregg Lind gregglind

View GitHub Profile
@gregglind
gregglind / jsonmangle.py
Created December 28, 2011 19:44
Search and Mangle json-like data structures
"""
Tasks
-------
Search and transform jsonable structures, specifically to make it 'easy' to make tabular/csv output for other consumers.
Example
~~~~~~~~~~~~~
@gregglind
gregglind / oxs-python.sh
Created January 9, 2012 16:36
Install Python Stuff on osx
## these are all untested!
# get a clean python, so you don't contaminate your system.
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
brew install python --framework
# run off and get xcode. Cry while it downloads and installs.
# distribute
@gregglind
gregglind / product.py
Created February 8, 2012 23:25
Recursive python "product"
"""
this has a lot of list / tuple casting, and doesn't use
native python list properties to full advantage.
It mimics Little Schemer style coding quite well though.
"""
import itertools
@gregglind
gregglind / bindFunction.js
Created February 10, 2012 17:41
JavaScript bug question.
/*
bindFunctions as implemented below has a bug.
1. What is the bug?
2. How do you fix it?
All functions have the args:
functionList: list of functions
@gregglind
gregglind / sample_broken_extensions.json
Created February 10, 2012 19:43
sample test pilot data
{
"extensions": [
{
"name": "Test Pilot",
"isEnabled": true,
"isPlatformCompatible": true,
"isCompatible": true,
"appDisabled": false,
"id": "testpilot?labs.mozilla.com"
},
@gregglind
gregglind / gist:1792214
Created February 10, 2012 19:53
confidence / fisher z score
'''
simple up / down 85% confidence score....
http://amix.dk/blog/post/19588?source=google
(among others)
'''
#Rewritten code from /r2/r2/lib/db/_sorts.pyx
from math import sqrt
@gregglind
gregglind / tp_2_study.js
Created March 6, 2012 14:18
SAMPLE TESTPILOT 2 Study, Showing all features.
/*****************************************
SAMPLE TESTPILOT 2 Study, Showing all features.
== things test pilot can and should do ==
load restartless extension
unload them
watch, dump, and record events, on XUL and HTML elements
- selectors can be commands, events, types
- actions can be specific things or "*"
@gregglind
gregglind / tp_2_study_v2.js
Created March 7, 2012 21:25
tp2 sample experiment 2
// do we want to do using 'register' instead?
var experiment = new require("test-pilot").Experiment();
// we can even get around the 'new' dangers using the jetpack utils.
// the idea is, it's a 'subclass', so that TP namespace is rolled in to an exp.
experiment.metadata = {
id: "",
summary: "",
}; // is this a problem that it doesn't go through 'guards'?
@gregglind
gregglind / combined.js
Created March 16, 2012 20:27
combined-study
/* version NEW */
BaseClasses = require("study_base_classes.js");
const ORIGINAL_TEST_ID = 100;
const MY_TEST_ID = "heatmap"; // We are on second run
/* Non-numeric IDs would be nicer but this is not supported in the extension
* yet. */
/* Explanation of the schema:
@gregglind
gregglind / code_of_conduct.txt
Created April 3, 2012 21:23
Draft Rebuild of Mozilla Code of Conduct
(this is a bit fragmentary. My goals:
* some mix of aspiration and operational
* I don't care what people believe, only how they act in the rooms
* I want acknowledgement of impact, and feelings.
* we might lose people over this. That doesn't make this not worthwhile
* The person impacted has agency to decide the impact on them.
)
Big principles: