This file contains 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/ruby | |
require 'google/apis/sheets_v4' | |
require 'googleauth' | |
require 'googleauth/stores/file_token_store' | |
require 'fileutils' | |
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob' | |
APPLICATION_NAME = 'Google Sheets API Test' |
This file contains 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
This is a collection view of vertically scrolling cells 1/3 high as wide and left hand image 1/3 width of screen with text label 2/3 screen width to the right of the image. This is completely created in code. I created a View Controller on the storyboard as I needed to attach a navgation controller. All you ever ever need to adjust is the imageAspectRatio and te image will always be 1/3 of the width of the cell row. | |
ViewController code. | |
import UIKit | |
let imageAspectRatio : CGFloat = 1.2 |
This file contains 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 | |
# you may need to use /usr/bin/ruby | |
def largest_hash_key(hash) | |
hash.max_by{|k,v| v} | |
end | |
filesystem = %x(df -h) | |
perfdata = filesystem.split("\n") |