This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// call when zoom level or page size changes (i.e. after zooming or after rotation) | |
- (void)updateContentInsetForPageScrollView:(UIScrollView *)pageScrollView { | |
UIImageView *imageView = (UIImageView *) [pageScrollView viewWithTag:TAG_IMAGE_VIEW]; | |
CGFloat zoomScale = pageScrollView.zoomScale; | |
CGSize imageSize = imageView.bounds.size; | |
CGSize zoomedImageSize = CGSizeMake(imageSize.width * zoomScale, imageSize.height * zoomScale); | |
CGSize pageSize = pageScrollView.bounds.size; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MLS | |
extend self | |
GRID = ("A".."R").to_a | |
SQUARE = ("0".."9").to_a | |
SUB = ("a".."x").to_a | |
deg = 180.0 | |
PARTS = [[18, GRID], [10, SQUARE], [24, SUB], [10, SQUARE]] | |
PARTS.map! { |div, part| [deg = deg / div, part] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# put in /etc/munin/plugins and restart munin-node | |
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin | |
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats | |
def output_config | |
puts <<-END | |
graph_category App | |
graph_title Passenger memory stats | |
graph_vlabel count |