This is a very simple lightweight plugin to allow you to move the caret (or cursor) position in an <input /> or <textarea> element.
By exposing three jQuery.fn methods you can easily move a a caret to any position you like:
| ### | |
| Author: Jason Giedymin <jasong _a_t_ apache -dot- org> | |
| http://www.jasongiedymin.com | |
| https://github.com/JasonGiedymin | |
| This CoffeeScript Javascript Fast Fibonacci code is | |
| based on the python code from Robin Houston's blog. | |
| See below links. | |
| A few things I want to introduce in time are implementions of |
| parseUrl = ( url = location.href ) -> | |
| params = {} | |
| ( ( parts = part.split( "=" ) ) && params[ parts[0] ] = parts[1] for part in ( url.split "?" ).pop().split "&" if url.indexOf( "?" ) != -1 ) && params || {} | |
| $ -> | |
| console.log parseUrl( "http://test.com/?a=b" ) | |
| console.log parseUrl( "http://test.com" ) | |
| console.log parseUrl() |
| (function addXhrProgressEvent($) { | |
| var originalXhr = $.ajaxSettings.xhr; | |
| $.ajaxSetup({ | |
| progress: function() { console.log("standard progress callback"); }, | |
| xhr: function() { | |
| var req = originalXhr(), that = this; | |
| if (req) { | |
| if (typeof req.addEventListener == "function") { | |
| req.addEventListener("progress", function(evt) { | |
| that.progress(evt); |
| <html> | |
| <head> | |
| <script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
| </head> | |
| <body> | |
| <h2>Naive canvas</h2> | |
| <canvas id="naive" width="400" height="50"></canvas> | |
| <h2>High-def Canvas</h2> |
| import re | |
| from django.utils.text import compress_string | |
| from django.utils.cache import patch_vary_headers | |
| from django import http | |
| try: | |
| import settings | |
| XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS |
| # Build an inverted index for a full-text search engine with Redis. | |
| # Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License. | |
| # USAGE: | |
| # | |
| # ruby invertedindex.rb add somedir/*.c | |
| # ruby invertedindex.rb add somedir/*.txt | |
| # ruby search your query string | |
| require 'rubygems' | |
| require 'redis' |