Skip to content

Instantly share code, notes, and snippets.

View hoang8f's full-sized avatar

Le Van Hoang hoang8f

  • Kaopiz Software Co., Ltd.
  • Hà Nội
View GitHub Profile
@phoet
phoet / pdf_support.rb
Created October 25, 2013 12:14
RSpec PDF content matcher
module PDF
class Loader
def self.content_for(body)
temp_pdf = Tempfile.new('pdf')
temp_pdf << body.force_encoding('UTF-8')
temp_pdf.close
receiver = PDF::SimplePageTextReceiver.new
PDF::Reader.file(temp_pdf.path, receiver)
receiver.content
@snikch
snikch / gist:3661188
Created September 6, 2012 23:16
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
package smoother;
import java.util.ArrayList;
import java.util.List;
import org.ejml.data.DenseMatrix64F;
import org.ejml.simple.SimpleMatrix;
import org.joda.time.DateTime;