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
# This snippet does everything I've ever wanted out of imagemagick. | |
# Equivalent to cropping to min(width, height) by min(width, height) and resizing to N x N. | |
# See http://www.imagemagick.org/Usage/thumbnails/#cut | |
# If you're writing this in bash or zsh, don't forget to escape the ^ with a backslash | |
convert -resize 256x256^ -extent 256x256 in.png out.png |
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
from google.appengine.ext import db, ndb | |
from google.appengine.datastore import entity_pb | |
def db_entity_to_protobuf(e): | |
return db.model_to_protobuf(e).Encode() | |
def protobuf_to_db_entity(pb): | |
# precondition: model class must be imported | |
return db.model_from_protobuf(entity_pb.EntityProto(pb)) |
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
var limit = 500; | |
$.get("/api/v1/dev/publish_list/" + limit + "?casing=camel").done(function(response) { | |
var statuses = _.chain(response) | |
.map(function(status) { | |
return { | |
timestamp: parseISO8601(status.startTime), | |
successful: status.success | |
} | |
}) |
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
Coach Reports | |
Exercise filter | |
/api/v1/exercise_topics | |
Student Progress | |
/api/v1/user/students/progressbystudent | |
Exercise Progress | |
/api/v1/user/students/progress/summary | |
Grid | |
/api/v1/user/students/progressreport | |
Activity |
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
This list is taken from my dev datastore so it might be slightly out | |
of date compared to the live site, but it's a good approximation. | |
Exponent properties | |
simplifying_expressions_with_exponents | |
simplifying_rational_expressions_1 | |
Factoring quadratics in two variables | |
factoring_polynomials_with_two_variables | |
Factoring simple expressions | |
factoring_linear_binomials |
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
{ | |
"translated_short_display_name": "", | |
"assessment_items": [], | |
"relative_url": "/exercise/multiplying_expressions_0.5", | |
"guaranteed_file_name": "multiplying_expressions_0.5.html", | |
"file_name": "multiplying_expressions_0.5.html", | |
"covers": [], | |
"creation_date": "2012-03-02T03:30:14Z", | |
"uses_assessment_items": false, | |
"ka_url": "http://www.khanacademy.org/exercise/multiplying_expressions_0.5", |
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
// promises is an array of jqXHRs or what have you | |
var deferreds = _.map(promises, function(promise) { | |
var deferred = $.Deferred(); | |
promise.then( | |
function() { | |
deferred.resolve(true); | |
}, | |
function() { | |
deferred.resolve(false); | |
} |
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
khan | |
khanacaste | |
khanacre | |
khanal | |
khanalbumin | |
khanamed | |
khanarial | |
khanarium | |
khanation | |
khanational |
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
var teaser = _.chain(data.stories) | |
.pluck("teaser") | |
.filter(function(t) { return !!t.length; }) | |
.shuffle() | |
.first() | |
.value(); |
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
var teaser = _.chain(data.stories) | |
.pluck("teaser") | |
.filter(function(t) { return t && t.length }) | |
.shuffle() | |
.first() | |
.value(); |
NewerOlder