Skip to content

Instantly share code, notes, and snippets.

View debussy2k's full-sized avatar

Harry Jung debussy2k

View GitHub Profile
@debussy2k
debussy2k / jquery.autogrow.js
Created June 26, 2012 03:00 — forked from kares/jquery.autogrow.js
simple jQuery plugin that allows textareas to grow vertically when text is typed in
/*
* Adapted from Autogrow Textarea Plugin
* @see http://www.technoreply.com/autogrow-textarea-plugin/
*/
(function($) {
$.fn.autoGrow = function() {
return this.each(function() {
var txtArea = $(this);
var colsDefault = txtArea.attr('cols');
var rowsDefault = txtArea.attr('rows');
@debussy2k
debussy2k / string.format.js
Created June 25, 2012 02:14 — forked from tbranyen/string.format.js
safer string formatting
// Inspired by http://bit.ly/juSAWl
// Augment String.prototype to allow for easier formatting. This implementation
// doesn't completely destroy any existing String.prototype.format functions,
// and will stringify objects/arrays.
String.prototype.format = function(i, safe, arg) {
function format() {
var str = this, len = arguments.length+1;
// For each {0} {1} {n...} replace with the argument in that position. If