Skip to content

Instantly share code, notes, and snippets.

importers = [
X2::StudentsImporter.new(mods: [
SomervilleHouseMod.new(),
])
X2::X2AssessmentImporter.new(),
X2::BehaviorImporter.new(),
X2::EducatorsImporter.new(),
X2::AttendanceImporter.new(),
X2::CoursesSectionsImporter.new(),
X2::StudentSectionAssignmentsImporter.new(),
function randomizeVoice(text, callback) {
const voices = window.speechSynthesis.getVoices();
const words = text.split(' ');
sayWords(words, voices, callback);
}
function sayWords(words, voices, callback) {
if (words.length === 0) return callback();
var voice = voices[Math.round(Math.random() * voices.length)];
sayWord(words[0], voice, () => sayWords(words.slice(1), voices));
@kevinrobinson
kevinrobinson / objects.txt
Created August 25, 2016 14:17
8/25 Student Insights memory, objects
$ bundle exec derailed bundle:objects
Measuring objects created by gems in groups [:default, "production"]
Total allocated: 29393076 bytes (218047 objects)
Total retained: 3032934 bytes (23234 objects)
allocated memory by gem
-----------------------------------
16638248 activesupport-4.2.6
6359714 sass-3.4.22
1447100 actionpack-4.2.6
@kevinrobinson
kevinrobinson / derailed_mem.txt
Created August 25, 2016 14:17
8/25 Student Insights memory
$ bundle exec derailed bundle:mem
TOP: 43.7344 MiB
rails/all: 15.9414 MiB
active_record/railtie: 7.4727 MiB
active_record: 6.2617 MiB (Also required by: orm_adapter/adapters/active_record)
arel: 3.6094 MiB (Also required by: active_record/base)
arel/nodes: 1.375 MiB
arel/visitors: 1.2969 MiB
arel/visitors/to_sql: 0.5234 MiB
active_record/connection_adapters/abstract_adapter: 1.2148 MiB
@kevinrobinson
kevinrobinson / flow-recursion-limit.js
Last active August 16, 2016 13:12
Trying to use disjoint unions in Flow
/* @flow */
// Modeled after https://github.com/facebook/flow/issues/1664#issuecomment-222934455
type AnimalT = {
id: number,
name: string
};
type CatT = AnimalT & {
isPurring: bool
};
type DogT = AnimalT & {
@kevinrobinson
kevinrobinson / tensorflow_visualization_data.sh
Created May 19, 2016 22:48
Script to generated JSON for TensorFlow codebase visualization
WORKING_DIR=~/Desktop # or whatever
du -a tensorflow > $WORKING_DIR/du-out.txt
cat $WORKING_DIR/du-out.txt \
| grep -v node_modules \
| grep -v tensorboard/ \
| grep -v examples/ \
| grep -v models/ \
| grep -v tools/ \
| grep -v g3doc/ \
> $WORKING_DIR/du-out-stripped.txt
REGISTER_OP("Assign")
.Input("ref: Ref(T)")
.Input("value: T")
.Output("output_ref: Ref(T)")
.Attr("T: type")
.Attr("validate_shape: bool = true")
.Attr("use_locking: bool = true")
.SetAllowsUninitializedInput()
node {
name: "W"
op: "Const"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
W = tf.Variable(tf.zeros([784, 10], name="W"))
node {
name: "Variable/Assign"
op: "Assign"
input: "Variable"
input: "a"
attr {
key: "T"
value {
type: DT_FLOAT
}