Here's what I did to get things working.
Yep, over at: https://developer.apple.com
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
Out of the box, SlidesJS does not provide the ability to add custom pagination. Although I love slides (it's my go-to for simple sliders), on a recent project I needed to ability to have small thumbnails for pagination.
With the simple addition of two attributes to the images and code the loaded callback for Slides, thumbnail pagination is possible (and simple).
| group :production do | |
| gem 'unicorn' | |
| # Enable gzip compression on heroku, but don't compress images. | |
| gem 'heroku-deflater' | |
| # Heroku injects it if it's not in there already | |
| gem 'rails_12factor' | |
| end |
"Russian-Doll Caching" is great. It embraces the Rails (and Ruby) goal to "make the developer happy". And it does. Not having to worry about cache expiration is superb.
It has its limits, though. If you're trying to avoid any database queries, russian-doll caching will not work for you. If you are trying to represent thousands, or even hundreds, of objects under a single cache fragment, russian-doll caching is not the best option.
We use it whenever it makes sense, but sometimes we just have to bite the bullet and expire a cache fragment manually. When you want to start manually expiring cache on a fairly busy website, you have to start considering race conditions. I recently ran into the following scenario:
class Post < ActiveRecord::Base
after_save :expire_cache
| //Enlarge all the bacon. | |
| $('.bacon').height(10000).refresh(); |
| class MyUploader < CarrierWave::Uploader::Base | |
| include Thumbkit::Adapters::CarrierWave | |
| # Watermark should always be processed after thumbkit, ensuring that we always | |
| # have a valid image and we don't need to change the extension | |
| def watermark(watermark_image, options = {}) | |
| cache_stored_file! if !cached? | |
| Watermarker.new(current_path, watermark_image).watermark!(options) | |
| end |
| /* | |
| * Normalized hide address bar for iOS & Android | |
| * (c) Scott Jehl, scottjehl.com | |
| * MIT License | |
| */ | |
| (function( win ){ | |
| var doc = win.document; | |
| // If there's a hash, or addEventListener is undefined, stop here | |
| if( !location.hash && win.addEventListener ){ |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| <!DOCTYPE html> | |
| <head> | |
| <title>Stay Standalone</title> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <script src="stay_standalone.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <ul> | |
| <li><a href="http://google.com/">Remote Link (Google)</a></li> |
These are some of my (Ryan Bates) favorite gems to use for various tasks: