Skip to content

Instantly share code, notes, and snippets.

View bigtunacan's full-sized avatar

Joiey Seeley bigtunacan

  • The University of Iowa
View GitHub Profile
@bigtunacan
bigtunacan / pdf.c
Last active December 12, 2015 02:28
Create a PDF from a webpage on iOS
- (NSString *)generatePDFFromWebView
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *pdfPath = [fileManager applicationSupportDirectory];
pdfPath = [pdfPath stringByAppendingPathComponent:@"exportedData.pdf"];
self.PDFCreator = [NDHTMLtoPDF createPDFWithURL:[NSURL URLWithString:@"www.cnn.com"]
pathForPDF:pdfPath
delegate:self
pageSize:kPaperSizeA4
require 'uri'
#require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
module WithinHelpers
def with_scope(locator)
locator ? within(locator) { yield } : yield
end
end
World(WithinHelpers)
@bigtunacan
bigtunacan / capybara_steps.rb
Created October 26, 2012 22:01
Capybara generic steps
require 'uri'
#require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
module WithinHelpers
def with_scope(locator)
locator ? within(locator) { yield } : yield
end
end
World(WithinHelpers)