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
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| % FILE: figure_format.m | |
| % AUTHOR: Elliott Richerson | |
| % DATE: March 4, 2009 | |
| % | |
| % DESCRIPTION: This function takes no inputs and formats any figures before | |
| % the 'figure_format' call is invoked. The formatter will attempt to | |
| % identify the type of plot and automatically locate and format lines, | |
| % axes, labels, title, legend, and surfaces. This is accomplished | |
| % primarily through testing default property values. |
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
| // | |
| // JSONExtension.swift | |
| // Created by Elliott Richerson on 10/8/15. | |
| // | |
| import Foundation | |
| import SwiftyJSON | |
| extension JSON { | |
| static func fromFile(name:String) -> JSON { |
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
| // | |
| // ISO8601DateFormatter.swift | |
| // Created by Elliott Richerson on 10/9/15. | |
| // References: http://nshipster.com/nsformatter/ | |
| // https://xkcd.com/1179/ | |
| // Example UTC String: "1987-01-03T00:00:00.000Z" | |
| import Foundation | |
| class ISO8601DateFormatter : NSDateFormatter { |
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
| // | |
| // PlaceholderTextView.swift | |
| // Created by Elliott Richerson on 10/10/15. | |
| // | |
| import UIKit | |
| class ExampleViewController: UIViewController { | |
| @IBOutlet weak var textViewPlaceholder: PlaceholderTextView! |
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
| // | |
| // Constants.swift | |
| // Created by Elliott Richerson on 10/10/15. | |
| // | |
| // Example usage: Constant.Text.PlaceholderUsername | |
| struct Constant { | |
| struct Text { | |
| static let PlaceholderUsername = "username" | |
| static let PlaceholderPassword = "password" |
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
| // | |
| // CustomNumberFormatter.swift | |
| // Created by Elliott Richerson on 10/9/15. | |
| // References: http://nshipster.com/nsformatter/ | |
| // | |
| import Foundation | |
| class CustomNumberFormatter : NSNumberFormatter { | |
| required init?(coder aDecoder: NSCoder) { |
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
| // | |
| // SwiftSingleton.swift | |
| // Created by Elliott Richerson on 10/25/15. | |
| // | |
| import Foundation | |
| class SwiftSingleton { | |
| static let sharedInstance = SwiftSingleton() | |
| private init() {} |
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
| // | |
| // UIFontExtension.swift | |
| // Created by Elliott Richerson on 10/30/15. | |
| // | |
| import UIKit | |
| extension UIFont { | |
| public static func printInstalledFonts() { | |
| for fontFamily in UIFont.familyNames() { |
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
| import React from "react"; | |
| export default class Video extends React.Component { | |
| resize = () => { | |
| // do work only if iframe exist | |
| if (this.iframeRef) { | |
| // recall our aspect ratio from props | |
| const { aspectRatio } = this.props; | |
| // get new width dynamically |
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
| def mapStructure(Map map, int layer = 0) { | |
| map.each { key, value -> | |
| println "${('\t' * layer) + key}: ${layer.toString()}" | |
| if(value.getClass() == LinkedHashMap.class) { | |
| mapStructure((Map)value, layer+1) | |
| } | |
| } | |
| } | |
| // Example usage: |
OlderNewer