Skip to content

Instantly share code, notes, and snippets.

@DoronShapiro
DoronShapiro / hw1.project.json
Last active December 25, 2015 09:29
hw1.project.json holds project data and is written centrally for every hw. Comments and grades are later written to this file as well. student_data.json is reused for every assignment.
{
"files": [
{
"name": "something.json",
"questions": [
{
"name": "someQuestion",
"tag": "let someQuestion",
"points": {
"style": 7,
@DoronShapiro
DoronShapiro / jquery.textfill.js
Last active December 11, 2015 08:09
Modified to fill either width or height
(function($) {
$.fn.textfill = function(percentMax, direction) {
percentMax = parseFloat(percentMax);
return this.each(function(){
var ourText = $("span", this),
parent = ourText.parent(),
maxHeight = parent.height(),
maxWidth = parent.width(),
fontSize = parseInt(ourText.css("fontSize"), 10),
multiplier = (direction == "width") ?