Skip to content

Instantly share code, notes, and snippets.

View jesstelford's full-sized avatar

Jess Telford jesstelford

View GitHub Profile
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,field/
--regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/f,field/
@jesstelford
jesstelford / jquery.textfill.js
Created February 1, 2012 00:57
jQuery Plugin to resize text to fit container
(function($) {
$.fn.textfill = function(maxFontSizePx, minFontSizePx, element) {
maxFontSizePx = parseInt(maxFontSizePx, 10);
minFontSizePx = parseInt(minFontSizePx, 10);
if (maxFontSizePx > 0 && minFontSizePx > maxFontSizePx) {
minFontSizePx = maxFontSizePx;
}
element = typeof(element) == "string" ? element : "span";
return this.each(function(){
var ourText = $(element, this),