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:
| #Deploy and rollback on Heroku in staging and production | |
| task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| namespace :deploy do | |
| PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
| STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
| task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
| task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
| Rails.application.routes.draw do | |
| get '/(:locale)/products/(:category)/(page/:page).:extension', | |
| :to => 'products#index', | |
| :as => :products, | |
| :constraints => { | |
| :locale => /[a-z]{2}/, | |
| :category => /.+?/, | |
| :page => /\d+/ | |
| }, |
| NOTE: You will need at least Redis 2.1.6 to use the ZREVRANGEBYSCORE method. | |
| Add players to HIGHSCORES table: | |
| fossil:~ dczarnecki$ redis-cli | |
| redis> zadd HIGHSCORES 1 player_1 | |
| (integer) 1 | |
| redis> zadd HIGHSCORES 2 player_2 | |
| (integer) 1 | |
| redis> zadd HIGHSCORES 3 player_3 |
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
| #!/usr/bin/env ruby | |
| #/ Usage: <progname> [options]... | |
| #/ How does this script make my life easier? | |
| # ** Tip: use #/ lines to define the --help usage message. | |
| $stderr.sync = true | |
| require 'optparse' | |
| # default options | |
| flag = false | |
| option = "default value" |
| From: Chris DeSalvo <[email protected]> | |
| Subject: Why we can't process Emoji anymore | |
| Date: Thu, 12 Jan 2012 18:49:20 -0800 | |
| Message-Id: <[email protected]> | |
| --Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B | |
| Content-Transfer-Encoding: quoted-printable | |
| Content-Type: text/plain; | |
| charset=utf-8 |
| # The following command works for downloading when using Git for Windows: | |
| # curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
| # | |
| # Download this file using PowerShell v3 under Windows with the following comand: | |
| # Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | |
| # | |
| # or wget: | |
| # wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
| # User-specific files |
| # Login as root | |
| ssh root@domain | |
| # Create deploy user | |
| adduser <username> #Adds User with username given. Enter Password when Prompted. Other Details are Optional | |
| # Add user to sudo group | |
| usermod -g <groupname> <username> | |
| # Add .ssh/authorized_keys for deploy user |
| + (UIImage *)imageResource:(NSString *)name ofType:(NSString *)type { | |
| NSString *systemVersion = UIDevice.currentDevice.systemVersion; | |
| NSString *iOSMajorSystemVersion = (systemVersion.length) ? [NSString stringWithFormat:@"iOS%@", [systemVersion substringToIndex:1]] : @"iOS"; | |
| if (UIScreen.mainScreen.bounds.size.height == 568.0f) { | |
| /* iPhone 5 */ | |
| NSString *iPhone5SystemVersionImageName = [NSString stringWithFormat:@"%@-%@-568h@2x", name, iOSMajorSystemVersion]; | |
| NSString *iPhone5SystemVersionImagePath = [NSBundle.mainBundle pathForResource:iPhone5SystemVersionImageName ofType:type]; | |