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:
| # 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' |
| 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 |
| <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> |
| (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); |
| 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() |
| ### | |
| 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 |
| # | |
| # Wide-open CORS config for nginx | |
| # | |
| location / { | |
| if ($request_method = 'OPTIONS') { | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| # |
| function interval(duration, fn){ | |
| var _this = this | |
| this.baseline = undefined | |
| this.run = function(){ | |
| if(_this.baseline === undefined){ | |
| _this.baseline = new Date().getTime() | |
| } | |
| fn() | |
| var end = new Date().getTime() |
| /** | |
| http://closure-library.googlecode.com/svn-history/r440/trunk/third_party/closure/goog/jpeg_encoder/jpeg_encoder_basic.js | |
| * @license | |
| Copyright (c) 2008, Adobe Systems Incorporated | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are | |
| met: |