Skip to content

Instantly share code, notes, and snippets.

View sanand0's full-sized avatar

S Anand sanand0

View GitHub Profile
@sanand0
sanand0 / Multiple-successive-vowels.txt
Created November 10, 2010 09:48
Words with multiple successive vowels
# See http://www.s-anand.net/blog/shortening-sentences/
# Removing vowels from words reduces the readability, but shrinks text by 18% [column 1]
# Removing only single vowels (e.g. read -> read, but yet -> yt) shrinks by 14% [column 2]
# Is the difference worth it? Here are some examples:
abbrviatn abbrviation
ablitn ablition
ablits ablities
abnd abound
abndng aboundng
@sanand0
sanand0 / textarea-maxlength.js
Created September 7, 2010 07:17
Restricts number of characters to maxlength in textarea
// Textarea maxlength
// Ensures that textarea's maxlength is validated
//
// (c) S Anand, 2010, MIT License
// Credits: http://yelotofu.com/2009/12/jquery-textarea-max-length/
// Credits: http://stackoverflow.com/questions/43569/max-length-for-html-text-areas
(function() {
var ignore = [8,9,13,33,34,35,36,37,38,39,40,46];
function limit(event) {
@sanand0
sanand0 / open.cmd
Created April 4, 2010 11:41
Opens files wherever they are in your machine. Change to any directory from anywhere.
@echo off
REM = """
REM python -x skipped that first line...
REM make sure that this file is saved with Windows newlines
REM make sure to change the next lines to whatever this file is called:
set FOLDER=D:/Apps/Misc
python -x %FOLDER%/o.cmd %*
if errorlevel == 1 goto changedir
goto end